Method and device for optimizing encoding/decoding of compensation offsets for a set of reconstructed samples of an image

ABSTRACT

The present invention provides a method and a device for coding and decoding at least a part of an image comprising a plurality of samples, each sample comprising at least two components, and the encoded image comprising at least one filtering parameter. The filtering comprises using at least one filtering parameter as a common filtering parameter for filtering both the first component and the second component of a reconstructed sample.

CROSS-REFERENCE TO RELATED APPLICATIONS

The application is the National Phase application of PCT Application No.PCT/EP2012/072071, filed on Nov. 7, 2012 and titled “Method and devicefor optimizing encoding/decoding of compensation offsets for a set ofreconstructed samples of an image.” This application claims the benefitunder 35 U.S.C. §119(a)-(d) of United Kingdom Patent Application Nos. GB1203285.0, filed on Feb. 24, 2012 and titled “Method and device forproviding compensation offsets for a set of reconstructed samples of animage” and GB1119206.9, filed on Nov. 7, 2011 and titled “Method anddevice for providing compensation offsets for a set of reconstructedsamples of an image,” and GB1205304.7 filed on Mar. 26, 2012 and titled“Method and device for optimizing encoding/decoding of compensationoffsets for a set of reconstructed samples of an image.” The above citedpatent applications are incorporated herein by reference in theirentirety.

The present invention relates to a method and device for optimizingencoding and/or decoding of compensation offsets for a set ofreconstructed samples of an image to improve the coding efficiency of avideo codec and/or the decoding complexity. The invention furtherconcerns a method and device for encoding or decoding a sequence ofdigital images.

The invention may be applied in the field of digital signal processing,and in particular in the field of video compression using motioncompensation to reduce spatial and temporal redundancies in videostreams.

Many video compression formats, such as for example H.263, H.264,MPEG-1, MPEG-2, MPEG-4, SVC, use block-based discrete cosine transform(DCT) and motion compensation to remove spatial and temporalredundancies. They are often referred to as predictive video formats.Each frame or image of the video signal is divided into slices which areencoded and can be decoded independently. A slice is typically arectangular portion of the frame, or more generally, a portion of aframe or an entire frame. Further, each slice may be divided intomacroblocks (MBs), and each macroblock is further divided into blocks,typically blocks of 64×64, 32×32, 16×16 or 8×8 pixels.

In High Efficiency Video Coding (HEVC) blocks of from 64×64, to 4×4 maybe used. The partitioning is organized according to a quad-treestructure based on the largest coding unit (LCU). An LCU corresponds,for example, to a square block of 64×64. If an LCU needs to be divided,a split flag indicates that the LCU is split into 4 32×32 blocks. In thesame way, if any of these 4 blocks need to be split, the split flag isset to true and the 32×32 block is divided into 4 16×16 blocks etc. Whena split flag is set to false, the current block is a coding unit CU. ACU has a size equal to 64×64, 32×32, 16×16 or 8×8 pixels.

There are two families of coding modes for coding blocks of an image:coding modes based on spatial prediction, referred to as INTRAprediction and coding modes based on temporal prediction (INTER, Merge,Skip). In both spatial and temporal prediction modes, a residual iscomputed by subtracting the prediction from the original block.

An INTRA block is generally predicted by an INTRA prediction processfrom the encoded pixels at its causal boundary. In INTRA prediction, aprediction direction is encoded.

Temporal prediction consists in finding in a reference frame, either aprevious or a future frame of the video sequence, an image portion orreference area which is the closest to the block to be encoded. Thisstep is typically known as motion estimation. Next, the block to beencoded is predicted using the reference area in a step typicallyreferred to as motion compensation—the difference between the block tobe encoded and the reference portion is encoded, along with an item ofmotion information relative to the motion vector which indicates thereference area to use for motion compensation. In temporal prediction,at least one motion vector is encoded.

In order to further reduce the cost of encoding motion information,rather than directly encoding a motion vector, assuming that motion ishomogeneous the motion vector may be encoded in terms of a differencebetween the motion vector and a motion vector predictor, typicallycomputed from one or more motion vectors of the blocks surrounding theblock to be encoded.

In H.264, for instance motion vectors are encoded with respect to amedian predictor computed from the motion vectors situated in a causalneighbourhood of the block to be encoded, for example from the threeblocks situated above and to the left of the block to be encoded. Onlythe difference, referred to as a residual motion vector, between themedian predictor and the current block motion vector is encoded in thebitstream to reduce the encoding cost.

Encoding using residual motion vectors saves some bitrate, butnecessitates that the decoder performs the same computation of themotion vector predictor in order to decode the value of the motionvector of a block to be decoded.

Both encoding and decoding processes may involve a decoding process ofan encoded image. This process is typically performed at the encoderside for the purpose of future motion estimation which enables anencoder and a corresponding decoder to have the same reference frames.

To reconstruct the coded frame, the residual is inverse quantized andinverse transformed in order to provide the “decoded” residual in thepixel domain. The first reconstruction is then filtered by one orseveral kinds of post filtering processes. These post filters areapplied on the reconstructed frame at encoder and decoder side in orderthat the same reference frame is used at both sides. The aim of thispost filtering is to remove compression artifacts and improve imagequality. For example, H.264/AVC uses a deblocking filter. This filtercan remove blocking artifacts due to the DCT quantization of residualand to block motion compensation. In the current HEVC standard, 3 typesof loop filters are used: deblocking filter, sample adaptive offset(SAO) and adaptive loop filter (ALF).

FIG. 1 is a flow chart illustrating steps of a loop filtering process ofa known HEVC implementation. In an initial step 101, the encoder ordecoder generates the reconstruction of the full frame. Next, in step102 a deblocking filter is applied on this first reconstruction in orderto generate a deblocked reconstruction 103. The aim of the deblockingfilter is to remove block artifacts generated by residual quantizationand block motion compensation or block Intra prediction. These artifactsare visually important at low bitrates. The deblocking filter operatesto smooth the block boundaries according to the characteristics of twoneighboring blocks. The encoding mode of each block, the quantizationparameters used for the residual coding, and the neighboring pixeldifferences in the boundary are taken into account. The samecriterion/classification is applied for all frames and no additionaldata is transmitted. The deblocking filter improves the visual qualityof the current frame by removing blocking artifacts and it also improvesthe motion estimation and motion compensation for subsequent frames.Indeed, high frequencies of the block artifact are removed, and so thesehigh frequencies do not need to be compensated for with the textureresidual of the following frames.

After the deblocking filter, the deblocked reconstruction is filtered bya sample adaptive offset (SAO) loop filter in step 104. The resultingframe 105 is then filtered with an adaptive loop filter (ALF) in step106 to generate the reconstructed frame 107 which will be displayed andused as a reference frame for the following Inter frames.

The aim of the SAO loop filter and the ALF is to improve framereconstruction by sending additional data as opposed to a deblockingfilter where no information is transmitted.

The principle of the SAO loop filter is to classify each pixel into aclass and to add the same offset value to the respective pixel value ofeach pixel of the class. Thus one offset is transmitted for each class.SAO loop filtering provides two kinds of classification for a framearea: Edge offset and Band offset. Edge offset classification involvesdetermining a class for each pixel by comparing its corresponding pixelvalue to the pixel values of two neighboring pixels. Moreover, the twoneighboring pixels depend on a parameter which indicates the directionof the 2 neighboring pixels. These directions are a 0-degree (horizontaldirection), a 45-degree (diagonal direction), a 90-degree (verticaldirection) and a 135-degree (second diagonal direction). A direction tobe used is given by an SAO parameter referred to as sao_type_idx in thecurrent HEVC specifications. Its value typically varies from zero tofive as shown in Table 1 of the Appendix. The sao_type_idx is also usedto indicate whether or not SAO filtering is to be carried out and thetype of SAO filtering.

For the sake of illustration, the offset to be added to a pixel value(or sample) C can be determined, for a given direction, according to therules as stated in Table 2 of the Appendix wherein Cn₁ and Cn₂ designatethe value of the two neighboring pixels or samples (according to thegiven direction). Accordingly, when the value C is less than the twovalues Cn₁ and Cn₂, the offset to be added to C is +O₁, when it is lessthan Cn₁ or Cn₂ and equal to the other value (Cn₁ or Cn₂), the offset tobe used is +O₂, when it is greater than Cn₁ or Cn₂ and equal to theother value (Cn₁ or Cn₂), the offset to be used is −O₃, and when it isgreater than Cn₁ and Cn₂, the offset to be used is −O₄. When none ofthese conditions are met, no offset value is added to the current pixelvalue C.

It is to be noted that according to the Edge Offset mode, only theabsolute value of each offset is encoded in the bitstream, the sign tobe applied being determined as a function of the category to which thecurrent pixel belongs. Therefore, according to Table 2 of the Appendix,a positive offset is associated with the categories 1 and 2 while anegative offset is associated with categories 3 and 4.

The second type of classification is a Band offset classification whichdepends on the pixel value. A class in an SAO Band offset corresponds toa range of pixel values. Thus, the same offset is added to all pixelshaving a pixel value within a given range of pixel values.

In order to be more adaptive to the frame content, SAO filtering isapplied on several frame areas which divide the current frame intoseveral spatial regions. Currently, frame areas correspond to a finitenumber of the Largest Coding Unit in HEVC. Consequently, one frame areamay or may not be filtered by SAO such that only some frame areas arefiltered. Moreover, when SAO is enabled, only one SAO classification isused: Edge offset or Band offset according to the related parameterstransmitted for each classification. Finally, for each SAO leaf node,the SAO classification as well as its parameters and the offsets of allclasses are transmitted.

An image of video data to be encoded may be provided as a set oftwo-dimensional arrays (also known as colour channels) of sample values,each entry of which represents the intensity of a colour component suchas a measure of luminance intensity and chrominance intensity fromneutral grayscale colour toward blue or red (YUV) or as a measure ofred, green, or blue light component intensity (RGB). A YUV model definesa colour space in terms of one luma (Y) and two chrominance (UV)components. Generally, Y stands for the luminance component and U and Vare the chrominance (colour) or chroma components.

SAO filtering is typically applied independently on Luma and on both Uand V Chroma components.

A known implementation of SAO Band offset splits the range of pixelvalues into 32 predefined ranges of the same size as depicted in FIG. 2.The minimum value of the range of pixel values is always zero and themaximum value depends on the bit-depth of the pixel values according tothe following relationship Max=2^(Bitdepth)−1.

Splitting the full range of pixel values into 32 ranges enables the useof five bits for classifying each pixel, allowing a fast classification.Accordingly only 5 bits are checked to classify a pixel in one of the 32classes or ranges of the full range. This is generally done by checkingthe five most significant bits of values encoded on 8 bits.

For example, when the bit-depth is 8 bits, the maximum possible value ofa pixel is 255. Thus, the range of pixel values is between 0 and 255.For this bit-depth of 8 bits, each class includes a range of 8 pixelvalues.

The aim of the SAO band filtering is the filtering of pixels belongingto a group of four consecutive classes or ranges that is determined bythe first class or band. The latter is transmitted in the bitstream sothat the decoder can determine the four consecutive classes or ranges ofthe pixels to be filtered. The parameter representing this position isreferred to as sao_band_position in the current HEVC specifications.

For the sake of illustration, a group of four consecutive classes orranges 201 to 204 of pixels to be filtered is represented in FIG. 2 as agrey area. As described above, this group can be identified by itsposition (e.g. sao_band_position). According to the given example, classor range 201 relates to pixels having values comprised between 64 and71. Similarly, classes or ranges 202 to 204 relate to pixels havingvalues comprised between 72 and 79, 80 and 87, 88 and 96, respectively.

FIG. 3 is a flow chart illustrating steps of a method for selectingoffsets in an encoder for a current frame area 303 (typically an LCUblock corresponding to one component of the processed image). The framearea contains N pixels. In an initial step 301, the variables Sum_(j)and SumNbPix_(j) are set to a value of zero for each of the four ranges.j denotes the current range or class number. Sum_(j) denotes the sum ofthe difference between the value of the pixels in the range j and thevalue of their corresponding original pixels. SumNbPix_(j) denotes thenumber of pixels in the range j.

In step 302, the counter variable i is set to the value zero. Next, thefirst pixel Pi of the frame area 303 is extracted in step 304 and theclass number J corresponding to the current pixel Pi is obtained in step305. Next, a test is performed in step 306 to determine whether or notthe class number J of the current pixel Pi corresponds to the value“N.A.” as described above by reference to Table 2 of the Appendix. Ifthe class number J of the current pixel Pi corresponds to the value“N.A.”, the value of counter variable i is incremented by one in orderto classify subsequent pixels of the frame area 303. Otherwise, if theclass number J of the current pixel Pi does not correspond to the value“N.A.”, the SumNbPix_(j) variable corresponding to the current pixel Piis incremented by one and the difference between P_(i) and its originalvalue P_(i) ^(org) is added to Sum_(j) in step 307.

In the following step, the counter variable i is incremented by one inorder to apply the classification to the other pixels of the frame area303. In step 309 it is determined whether or not all the N pixels of theframe area 303 have been classified (i.e. is i≦=N), if yes, anOffset_(j) for each class is computed in step 310 in order to produce anoffset table 311 presenting an offset for each class j as the finalresult of the offset selection algorithm. This offset is computed as theaverage of the difference between the pixel values of the pixels ofclass j and their respective original pixel values. The, Offset_(j) forclass j is given by the following equation:

${Offset}_{j} = \frac{{Sum}_{j}}{{SumNbPix}_{j}}$

The computed offset Offset_(j) can be considered as an optimal offset interms of distortion. It is referred to as Oopt_(j) in the following.From this offset, it is possible to determine an improved offset valueO_RD_(j) according to a rate distortion criterion.

FIG. 4 is a flow chart illustrating steps of a method for determining animproved offset according to a rate distortion criterion. In an initialstep 401, a rate distortion value J_(j) of the current range or classnumber j is initialized to a predetermined maximum possible value(MAX_VALUE).

Next, a loop is launched at step 402 to make offset O_(j) vary fromOopt_(j) to zero. If value Oopt_(j) is negative, variable O_(j) isincremented by one until it reaches zero and if value Oopt_(j) ispositive, variable O_(j) is decremented by one until it reaches zero.

In step 403, the rate distortion cost related to variable O_(j), denotedJ(O_(j)), is computed, for example according to the following formula:J(O _(j))=SumNbPix _(j) ×O _(j) ×O _(j)−Sum_(j) ×O _(j)×2+λR(O _(j))

λ is the Lagrange parameter and R(O_(j)) is a function which providesthe number of bits needed for the codeword associated with O_(j). Thepart of the formula corresponding toSumNbPix_(j)×O_(j)×O_(j)−Sum_(j)×O_(j)×2 relates to the improvement interms of distortion given by the offset O_(j).

In step 404, the values J(O_(j)) and J_(j) are compared each other. Ifthe value J(O_(j)) is less than the value J_(j) then J_(j) is set to thevalue of J(O_(j)) and O_RD_(j) set to the value of O_(j).

In step 405 it is determined whether or not all the possible values ofthe offset O_(j) have been processed (i.e. is O_(j)=0). If offset O_(j)is equal to zero the loop is ended and an improved offset value(O_RD_(j)) for the class j has been identified. Otherwise, the loopcontinues with the next O_(j) value.

It is noted that the algorithm described by reference to FIG. 3 can beused to determine a position of a first class or range(sao_band_position) according to a Band offset classification type. Tothat end, index j represents a value of the interval [0, 32] (instead of[1, 4]). In other words, the value 4 is replaced by the value 32 inmodules 301, 310, and 311 of FIG. 3.

More specifically, the difference Sum_(j) between the value of thecurrent pixel and its original value Porg_(i) can be computed for eachof the 32 classes represented in FIG. 2, that is to say for each range j(j belonging to the interval [0, 32]).

Next, an improved offset O_RD_(j), in terms of rate distortion, can becomputed for the 32 classes according to an algorithm similar to the onedescribed by reference to FIG. 4.

Next, the position of the first class or range can be determined.

FIG. 5 is a flow chart illustrating steps of a method for determining anSAO band position for SAO Band offset of HEVC. Since these steps arecarried out after the ones described by reference to FIG. 4, the ratedistortion value denoted J_(j) has already been computed for each classj.

In an initial step 501, the rate distortion value J is initialized to apredetermined maximum possible value (MAX_VALUE). Next, a loop islaunched at step 502 to make index i vary from zero to 27, correspondingto the 28 possible positions of the first class of the group of fourconsecutive classes.

In step 503, the variable J′_(j) corresponding to the rate distortionvalue of the current band, that is to say the band comprising fourconsecutive classes from the class having the index i, is initialized tozero. Next, a loop is launched at step 504 to make index j vary from ito i+3, corresponding to the 4 classes of the current band.

Next, in step 505, the value of the variable J′_(i) is incremented bythe value of the rate distortion value of the class having index j(J_(j)). This step is repeated for the four classes of the current band,that is to say until index j reaches i+3 (step 506). In step 507, a testis performed to determine whether or not the rate distortion valueJ′_(j) of the current band is less than the rate distortion value J. Ifthe rate distortion value J′_(j) of the current band is less than therate distortion value J, the rate distortion value J is set to the valueof the rate distortion J′_(j) of the current band and the band positionvalue denoted sao_band_position is set to the value of the index i.

These steps are repeated for the 28 possible positions of the firstclass of the group of four consecutive classes (step 508) to determinethe band position to be used.

FIG. 6 is a flow chart illustrating steps of a method for filtering aframe area, typically an LCU block corresponding to one component of aprocessed image, according to an SAO loop filter.

Such an algorithm is generally implemented in the decoder to decodeframes and in the encoder to generate reference frames that are used formotion estimation and compensation of following frames.

In an initial step 601, SAO filtering parameters are obtained, forexample from a received bitstream. For a given frame area, theseparameters typically comprise four offsets that can be stored in table603 and a parameter of the sao_type_idx. Depending on the latter, theseparameters may further comprise an SAO band position. For the sake ofillustration, if an obtained parameter of the sao_type_idx type is equalto five, the corresponding parameter of the sao_band_position type isthen obtained (602). Other parameters as the ones allowing to determinethe value of an SAO parameter of a given frame area as a function of thevalue of the corresponding parameter of a previous frame area can beobtained. It is to be noted that a given value of a given SAO parameter,such as the value zero for the sao_type_idx parameter may indicate thata SAO filtering is not to be applied.

In step 604, the counter variable i is set to the value zero. Next, thefirst pixel P_(i) of the frame area 605, comprising N pixels, isextracted at step 606 and classified at step 607 according to the Edgeoffset classification or Band offset classification as describedpreviously.

In step 608 a test is performed to determine whether or not pixel P_(i)belongs to a class of pixels to be filtered. If pixel P_(i) belongs to aclass of pixels to be filtered, its related class number j is identifiedand its related offset value Offset_(j) is obtained at step 610 from theoffsets table 603. Next, in step 611, Offset_(j) is added to the valueof pixel P_(i) in order to produce a new pixel value referred to asP′_(i) (612). In step 613, pixel P′_(i) replaces pixel Pi in theprocessed frame area 616. Otherwise, if pixel P_(i) does not belong to aclass of pixels to be filtered, pixel P_(i) 609 remains unchanged inframe area at step 613.

Next, after having processed pixel P_(i), counter variable i isincremented by one at step 614 in order to apply the filter similarly tothe next pixel of the current frame area 605.

In step 615 it is determined whether or not all the N pixels of thecurrent frame area 605 have been processed (i≧N). If yes, the processedframe area 616 is reconstructed and can be added to the SAOreconstructed frame as described above by reference to FIG. 1 (reference105).

A drawback of the known process for selection and transmission ofcompensations is that it a great number of parameters have to betransmitted from the encoder to the decoder and stored in an SAO buffer.Moreover, the process carried out by the decoder for decoding andprocessing these parameters is complex.

The present invention has been devised to address one or more of theforegoing concerns.

According to a first aspect of the present invention there is provided amethod of encoding at least a part of an image comprising a plurality ofsamples, each sample comprising at least two components, the encodedimage comprising at least one filtering parameter, the method comprising

encoding a first and a second component of at least one sample of theimage to provide at least one encoded sample;

decoding the at least one encoded sample;

computing the at least one filtering parameter as a function of thedifference between at least one component of the at least one sample ofthe image and the at least one corresponding component of the at leastone corresponding decoded sample, the at least one filtering parameterbeing computed so as to be used in a loop filter as a common filteringparameter for filtering both the first and second components of adecoded sample.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

According to a second aspect of the present invention there is provideda method of decoding at least a part of an image comprising a pluralityof samples, each sample comprising at least two components, the encodedimage comprising at least one filtering parameter, the method comprising

decoding a first and a second component of at least one encoded sampleto provide a first and a second component of at least one reconstructedsample;

decoding the at least one filtering parameter;

filtering the at least one reconstructed sample in a loop filter, thefiltering comprising using at least one decoded filtering parameter as acommon filtering parameter for filtering both the first component andthe second component of the at least one reconstructed sample.

According to a third aspect of the present invention there is providedan encoding device for encoding at least a part of an image comprising aplurality of samples, each sample comprising at least two components,the encoded image comprising at least one filtering parameter, theencoding device comprising

means for encoding a first and a second component of at least one sampleof the image to provide at least one encoded sample;

means for decoding the at least one encoded sample;

means for computing the at least one filtering parameter as a functionof the difference between at least one component of the at least onesample of the image and the at least one corresponding component of theat least one corresponding decoded sample, the at least one filteringparameter being computed so as to be used in a loop filter as a commonfiltering parameter for filtering both the first and second componentsof a decoded sample.

According to a fourth aspect of the present invention there is provideda decoding device for decoding at least a part of an image comprising aplurality of samples, each sample comprising at least two components,the encoded image comprising at least one filtering parameter, thedecoding device comprising

means for decoding a first and a second component of at least oneencoded sample to provide a first and a second component of at least onereconstructed sample;

means for decoding the at least one filtering parameter;

means for filtering the at least one reconstructed sample in a loopfilter, the filtering comprising using at least one decoded filteringparameter as a common filtering parameter for filtering both the firstcomponent and the second component of the at least one reconstructedsample.

At least parts of the methods according to the invention may be computerimplemented. Accordingly, the present invention may take the form of anentirely hardware embodiment, an entirely software embodiment (includingfirmware, resident software, micro-code, etc.) or an embodimentcombining software and hardware aspects that may all generally bereferred to herein as a “circuit”, “module” or “system”. Furthermore,the present invention may take the form of a computer program productembodied in any tangible medium of expression having computer usableprogram code embodied in the medium.

Since the present invention can be implemented in software, the presentinvention can be embodied as computer readable code for provision to aprogrammable apparatus on any suitable carrier medium. A tangiblecarrier medium may comprise a storage medium such as a floppy disk, aCD-ROM, a hard disk drive, a magnetic tape device or a solid statememory device and the like. A transient carrier medium may include asignal such as an electrical signal, an electronic signal, an opticalsignal, an acoustic signal, a magnetic signal or an electromagneticsignal, e.g. a microwave or RF signal.

Thus, according to a fifth aspect of the present invention there isprovided a computer program product for a programmable apparatus, thecomputer program product comprising a sequence of instructions forimplementing each step of a method embodying the aforesaid first orsecond aspect of the present invention when loaded into and executed bythe programmable apparatus.

Similarly, according to a sixth aspect of the present invention there isprovided a computer-readable storage medium storing instructions of acomputer program for implementing each step of a method embodying theaforesaid first or second aspect of the present invention.

Embodiments of the invention will now be described, by way of exampleonly, and with reference to the following drawings in which:

FIG. 1 is a flow chart illustrating steps of a loop filtering process ofthe prior art;

FIG. 2 graphically illustrates a sample adaptive Band offsetclassification of an HEVC process of the prior art;

FIG. 3 is a flow chart illustrating steps of a process for determiningcompensation offsets for SAO Band offset of HEVC;

FIG. 4 is a flow chart illustrating a process to select an SAO offsetfrom a rate-distortion point of view;

FIG. 5 is a flow chart illustrating steps of a method for determining anSAO band position for SAO Band offset of HEVC;

FIG. 6 is a flow chart illustrating steps of a method for filtering aframe area according to an SAO loop filter;

FIG. 7 is a block diagram schematically illustrating a datacommunication system in which one or more embodiments of the inventionmay be implemented;

FIG. 8 is a block diagram illustrating components of a processing devicein which one or more embodiments of the invention may be implemented;

FIG. 9 is a flow chart illustrating steps of an encoding methodaccording to embodiments of the invention;

FIG. 10 is a flow chart illustrating steps of a loop filtering processin accordance with one or more embodiments of the invention;

FIG. 11 is a flow chart illustrating steps of a decoding methodaccording to embodiments of the invention;

FIG. 12 is a flow chart illustrating steps of a method for obtaining SAOparameters from a bitstream according to an Adaptive Parameter Set mode;

FIG. 13 is a flow chart illustrating steps of a method for obtaining SAOparameters from a bitstream according to an LCU mode;

FIG. 14 is a flow chart illustrating steps of a method for reading SAOparameters in a bitstream;

FIGS. 15 and 16 are flow charts illustrating steps of a method accordingto a first embodiment of the invention for determining parameters to beused in a loop filter for processing a current frame area;

FIG. 17 illustrates a particular embodiment according to which thevalues of the offsets associated with a component correspond to themirrored values of the offsets associated with a second component;

FIG. 18 illustrates how values of offsets associated with a secondcomponent can be obtained from values of offsets associated with a firstcomponent when applying an SAO loop filter using a Band offsetclassification;

FIG. 19 illustrates how a value of the sao_band_position parameterassociated with a second component Z can be obtained from the value ofthe sao_band_position parameter associated with a first component X whenapplying an SAO loop filter using a Band offset classification

FIG. 20 is a flow chart illustrating steps of a method for determiningan optimal offset to be used by two or three components according to arate distortion criterion;

FIG. 21 is a flow chart illustrating steps of a method for determiningan SAO band position shared between two components;

FIG. 22 is a flow chart illustrating steps of a method for decoding abitstream according to a particular embodiment of the invention; and

FIG. 23 illustrates the use of SAO classification of one component X tosimilarly filter another component Z.

FIG. 7 illustrates a data communication system in which one or moreembodiments of the invention may be implemented. The data communicationsystem comprises a transmission device, in this case a server 701, whichis operable to transmit data packets of a data stream to a receivingdevice, in this case a client terminal 702, via a data communicationnetwork 700. The data communication network 700 may be a Wide AreaNetwork (WAN) or a Local Area Network (LAN). Such a network may be forexample a wireless network (Wifi/802.11a or b or g), an Ethernetnetwork, an Internet network or a mixed network composed of severaldifferent networks. In a particular embodiment of the invention the datacommunication system may be a digital television broadcast system inwhich the server 701 sends the same data content to multiple clients.

The data stream 704 provided by the server 701 may be composed ofmultimedia data representing video and audio data. Audio and video datastreams may, in some embodiments of the invention, be captured by theserver 701 using a microphone and a camera respectively. In someembodiments data streams may be stored on the server 701 or received bythe server 701 from another data provider, or generated at the server701. The server 701 is provided with an encoder for encoding video andaudio streams in particular to provide a compressed bitstream fortransmission that is a more compact representation of the data presentedas input to the encoder.

In order to obtain a better ratio of the quality of transmitted data toquantity of transmitted data, the compression of the video data may befor example in accordance with the HEVC format or H.264/AVC format.

The client 702 receives the transmitted bitstream and decodes thereconstructed bitstream to reproduce video images on a display deviceand the audio data by a loudspeaker.

Although a streaming scenario is considered in the example of FIG. 7, itwill be appreciated that in some embodiments of the invention the datacommunication between an encoder and a decoder may be performed usingfor example a media storage device such as an optical disc.

In one or more embodiments of the invention a video image is transmittedwith data representing of compensation offsets for application toreconstructed pixels of the image to provide filtered pixels in a finalimage.

FIG. 8 schematically illustrates a processing device 800 configured toimplement at least one embodiment of the present invention. Theprocessing device 800 may be a device such as a micro-computer, aworkstation or a light portable device. The device 800 comprises acommunication bus 813 connected to:

-   -   a central processing unit 811, such as a microprocessor, denoted        CPU;    -   a read only memory 807, denoted ROM, for storing computer        programs for implementing the invention;    -   a random access memory 812, denoted RAM, for storing the        executable code of the method of embodiments of the invention as        well as the registers adapted to record variables and parameters        necessary for implementing the method of encoding a sequence of        digital images and/or the method of decoding a bitstream        according to embodiments of the invention; and    -   a communication interface 802 connected to a communication        network 803 over which digital data to be processed are        transmitted or received

Optionally, the apparatus 800 may also include the following components:

-   -   a data storage means 804 such as a hard disk, for storing        computer programs for implementing methods of one or more        embodiments of the invention and data used or produced during        the implementation of one or more embodiments of the invention;    -   a disk drive 805 for a disk 806, the disk drive being adapted to        read data from the disk 806 or to write data onto said disk;    -   a screen 809 for displaying data and/or serving as a graphical        interface with the user, by means of a keyboard 810 or any other        pointing means.

The apparatus 800 can be connected to various peripherals, such as forexample a digital camera 820 or a microphone 808, each being connectedto an input/output card (not shown) so as to supply multimedia data tothe apparatus 800.

The communication bus provides communication and interoperabilitybetween the various elements included in the apparatus 800 or connectedto it. The representation of the bus is not limiting and in particularthe central processing unit is operable to communicate instructions toany element of the apparatus 800 directly or by means of another elementof the apparatus 800.

The disk 806 can be replaced by any information medium such as forexample a compact disk (CD-ROM), rewritable or not, a ZIP disk or amemory card and, in general terms, by an information storage means thatcan be read by a microcomputer or by a microprocessor, integrated or notinto the apparatus, possibly removable and adapted to store one or moreprograms whose execution enables the method of encoding a sequence ofdigital images and/or the method of decoding a bitstream according tothe invention to be implemented.

The executable code may be stored either in read only memory 807, on thehard disk 804 or on a removable digital medium such as for example adisk 806 as described previously. According to a variant, the executablecode of the programs can be received by means of the communicationnetwork 803, via the interface 802, in order to be stored in one of thestorage means of the apparatus 800 before being executed, such as thehard disk 804.

The central processing unit 811 is adapted to control and direct theexecution of the instructions or portions of software code of theprogram or programs according to the invention, instructions that arestored in one of the aforementioned storage means. On powering up, theprogram or programs that are stored in a non-volatile memory, forexample on the hard disk 804 or in the read only memory 807, aretransferred into the random access memory 812, which then contains theexecutable code of the program or programs, as well as registers forstoring the variables and parameters necessary for implementing theinvention.

In this embodiment, the apparatus is a programmable apparatus which usessoftware to implement the invention. However, alternatively, the presentinvention may be implemented in hardware (for example, in the form of anApplication Specific Integrated Circuit or ASIC).

FIG. 9 illustrates a block diagram of an encoder 900 according to atleast one embodiment of the invention. The encoder is represented byconnected modules, each module being adapted to implement, for examplein the form of programming instructions to be executed by the CPU 811 ofdevice 800, at least one corresponding step of a method implementing atleast one embodiment of encoding an image of a sequence of imagesaccording to one or more embodiments of the invention.

An original sequence of digital images i0 to in 901 is received as aninput by the encoder 900. Each digital image is represented by a set ofsamples, known as pixels.

A bitstream 910 is output by the encoder 900 after implementation of theencoding process. The bitstream 910 comprises a plurality of encodingunits or slices, each slice comprising a slice header for transmittingencoding values of encoding parameters used to encode the slice and aslice body, comprising encoded video data.

The input digital images i0 to in 901 are divided into blocks of pixelsby module 902. The blocks correspond to image portions and may be ofvariable sizes (e.g. 4×4, 8×8, 16×16, 32×32, 64×64 pixels). A codingmode is selected for each input block. Two families of coding modes areprovided: coding modes based on spatial prediction coding (Intraprediction), and coding modes based on temporal prediction (Intercoding, Merge, SKIP). The possible coding modes are tested.

Module 903 implements an Intra prediction process, in which the givenblock to be encoded is predicted by a predictor computed from pixels ofthe neighborhood of said block to be encoded. An indication of theselected Intra predictor and the difference between the given block andits predictor is encoded to provide a residual if the Intra coding isselected.

Temporal prediction is implemented by motion estimation module 904 andmotion compensation module 905. Firstly a reference image from among aset of reference images 916 is selected, and a portion of the referenceimage, also called reference area or image portion, which is the closestarea to the given block to be encoded, is selected by the motionestimation module 904. Motion compensation module 905 then predicts theblock to be encoded using the selected area. The difference between theselected reference area and the given block, also called a residualblock, is computed by the motion compensation module 905. The selectedreference area is indicated by a motion vector.

Thus in both cases (spatial and temporal prediction), a residual iscomputed by subtracting the prediction from the original block.

In the INTRA prediction implemented by module 903, a predictiondirection is encoded. In the temporal prediction, at least one motionvector is encoded.

Information relative to the motion vector and the residual block isencoded if the Inter prediction is selected. To further reduce thebitrate, assuming that motion is homogeneous, the motion vector isencoded by difference with respect to a motion vector predictor. Motionvector predictors of a set of motion information predictors are obtainedfrom the motion vectors field 918 by a motion vector prediction andcoding module 917.

The encoder 900 further comprises a selection module 906 for selectionof the coding mode by applying an encoding cost criterion, such as arate-distortion criterion. In order to further reduce redundancies atransform (such as DCT) is applied by transform module 907 to theresidual block, the transformed data obtained is then quantized byquantization module 908 and entropy encoded by entropy encoding module909. Finally, the encoded residual block of the current block beingencoded is inserted into the bitstream 910.

The encoder 900 also performs decoding of the encoded image in order toproduce a reference image for the motion estimation of the subsequentimages. This enables the encoder and the decoder receiving the bitstreamto have the same reference frames. The inverse quantization module 911performs inverse quantization of the quantized data, followed by aninverse transform by reverse transform module 912. The reverse intraprediction module 913 uses the prediction information to determine whichpredictor to use for a given block and the reverse motion compensationmodule 914 actually adds the residual obtained by module 912 to thereference area obtained from the set of reference images 916.

Post filtering is then applied by module 915 to filter the reconstructedframe of pixels. In the embodiments of the invention an SAO loop filteris used in which compensation offsets are added to the pixel values ofthe reconstructed pixels of the reconstructed image

FIG. 10 is a flow chart illustrating steps of loop filtering processaccording to at least one embodiment of the invention. In an initialstep 1001, the encoder generates the reconstruction of the full frame.Next, in step 1002 a deblocking filter is applied on this firstreconstruction in order to generate a deblocked reconstruction 1003. Theaim of the deblocking filter is to remove block artifacts generated byresidual quantization and block motion compensation or block Intraprediction. These artifacts are visually important at low bitrates. Thedeblocking filter operates to smooth the block boundaries according tothe characteristics of two neighboring blocks. The encoding mode of eachblock, the quantization parameters used for the residual coding, and theneighboring pixel differences in the boundary are taken into account.The same criterion/classification is applied for all frames and noadditional data is transmitted. The deblocking filter improves thevisual quality of the current frame by removing blocking artifacts andit also improves the motion estimation and motion compensation forsubsequent frames. Indeed, high frequencies of the block artifact areremoved, and so these high frequencies do not need to be compensated forwith the texture residual of the following frames.

After the deblocking filter, the deblocked reconstruction is filtered bya sample adaptive offset (SAO) loop filter in step 1004 based on aclassification of pixels. The resulting frame 1005 may then be filteredwith an adaptive loop filter (ALF) in step 1006 to generate thereconstructed frame 1007 which will be displayed and used as a referenceframe for the following Inter frames.

In step 1004 each pixel of the frame area is classified into a class ofthe determined classification according to its pixel value. A classcorresponds to a determined range of pixel values. The same compensationoffset value is added to the pixel value of all pixels having a pixelvalue within the given range of pixel values.

The coding and/or decoding of SAO parameters to be exchanged between aserver and a client and/or stored locally or remotely for decodingpixels for the sample adaptive offset filtering will be explained inmore detail hereafter with reference to any one of FIGS. 12 to 23.

FIG. 11 illustrates a block diagram of a decoder 1100 which may be usedto receive data from an encoder according an embodiment of theinvention. The decoder is represented by connected modules, each modulebeing adapted to implement, for example in the form of programminginstructions to be executed by the CPU 811 of device 800, acorresponding step of a method implemented by the decoder 1100.

The decoder 1100 receives a bitstream 1101 comprising encoding units,each one being composed of a header containing information on encodingparameters and a body containing the encoded video data. As explainedwith respect to FIG. 9, the encoded video data is entropy encoded, andthe motion vector predictors' indexes are encoded, for a given block, ona predetermined number of bits. The received encoded video data isentropy decoded by module 1102. The residual data are then dequantizedby module 1103 and then a reverse transform is applied by module 1104 toobtain pixel values.

The mode data indicating the coding mode are also entropy decoded, andbased on the mode, an INTRA type decoding or an INTER type decoding isperformed on the encoded blocks of image data.

In the case of INTRA mode, an INTRA predictor is determined by intrareverse prediction module 1105 based on the intra prediction modespecified in the bitstream.

If the mode is INTER, the motion prediction information is extractedfrom the bitstream so as to find the reference area used by the encoder.The motion prediction information is composed of the reference frameindex and the motion vector residual. The motion vector predictor isadded to the motion vector residual in order to obtain the motion vectorby motion vector decoding module 1110.

Motion vector decoding module 1110 applies motion vector decoding foreach current block encoded by motion prediction. Once an index of themotion vector predictor, for the current block has been obtained theactual value of the motion vector associated with the current block canbe decoded and used to apply reverse motion compensation by module 1106.The reference image portion indicated by the decoded motion vector isextracted from a reference image 1108 to apply the reverse motioncompensation 1106. The motion vector field data 1111 is updated with thedecoded motion vector in order to be used for the inverse prediction ofsubsequent decoded motion vectors.

Finally, a decoded block is obtained. Post filtering is applied by postfiltering module 1107 similarly to post filtering module 915 applied atthe encoder as described with reference to FIG. 9. A decoded videosignal 1109 is finally provided by the decoder 1000.

FIG. 12 is a flow chart illustrating steps of a method for obtaining SAOparameters from a bitstream according to an Adaptive Parameter Set (APS)mode. Accordingly, FIG. 12 illustrates how SAO parameters are stored ina bitstream when the Adaptive Parameter Set mode is used to associate asingle set of SAO parameters per frame area. According to this mode, aset of SAO parameters is valid for a rectangular frame area whose sizeis a multiple of the size of the Largest Coding Unit (LCU). In order toreduce the amount of bits to store all the SAO parameters of a frame forthis particular mode, a run-length coding technique is used as well as aprediction flag from the above frame area.

According to the APS mode implemented in the current specifications ofHEVC, there are flags indicating whether or not SAO loop filtering isenabled for the components of a given picture. This means that, forexample, when considering a picture encoded according to the YUV scheme,SAO parameters for the U or the V component can be either enabled ordisabled.

Such flags are read in an initial step 1201. Next, in step 1202 the sizeof the frame area to which a set of SAO parameters are to be applied isobtained. As described above, the frame area where the SAO loopfiltering has to be applied when using the APS mode, corresponds to anarea which is equal to the LCU size or which corresponds to a multiplesize of the LCU size.

Next, a loop is launched at step 1203 to handle successively each colorcomponent of the sequence denoted X. This loop enables reading the“unicity” flag for each component which is performed at step 1204. Next,a test is performed at step 1205 to determine whether or not the read“unicity” flag is true. If the read “unicity” flag is true, it onlyexists one single SAO parameter set, regarding the current processedcomponent X, for the whole image. In such a case, the SAO parameters areread in the bitstream at step 1206. Such a step is described in detailby reference to FIG. 14. Otherwise, if the read “unicity” flag is nottrue, there are more than one SAO parameter for the whole imageregarding the current processed component X. In such a case, the SAOparameters are read in following steps as described by reference tosteps 1208 to 1218.

Next, a test is performed at step 1207 to determine whether or not thecurrent processed component X is the last component to process. If thecurrent processed component X is the last component to process, thealgorithm is branched to step 1203 and the previous steps are repeatedfor the remaining component(s).

It is to be noted that if the “unicity” flag is true for one component,the steps 1208 to 1218 are not performed for that component.

From step 1208, SAO parameters are determined for each frame area andfor each component when there exist more than one set of SAO parametersper component.

A loop is launched at step 1208 to handle successively each frame areaof the given picture to be processed according to the frame area sizedetermined at step 1202. In the given example of FIG. 12, the frameareas are processed in raster scan order whreby the process starts withthe first row of frame areas of the image and continues until the lastrow of the image. Frame areas are processed from the left side to theright side of the image.

Next, another loop is launched at step 1209 to handle successively eachcomponent denoted X. It is to be noted here that if the “enable” flag ofthe current component, read at step 1201, is false, the next steps forthe component concerned are ignored at step 1209 and the next componentis selected to be processed. In step 1210 a “repeat row flag” is read.Next, in step 1211 a test is performed to determine whether or not thatflag is true. If it is true, the SAO parameters of the previous row offrame area are used for the current row of frame area. This makes itpossible to save many bits in representing the SAO parameters in thebitstream by just signaling that the current row uses the sameparameters as the previous row.

Otherwise, if the read “repeat row flag” is false, the current framearea is coded in the bitstream and the algorithm is branched to step1213 where a test is performed to determine whether or not a predictivetechnique (using run-length coding or the value of the SAO parameters ofthe above frame area) is used to encode and represent the SAO parametersassociated with a previous frame area in the current row. In that case,the SAO parameters of the current frame area are deduced, in the currentrow, at step 1214, from a previous frame area. More specifically, twosyntax elements are used: sao_run_diff and sao_merge_up_flag thatrespectively indicate if the SAO parameters are coded according to arun-length method or are deduced from the SAO parameters of the aboveframe area. Otherwise, if the answer is negative in step (1213), the SAOparameters for this particular frame area are explicitly coded in thebitstream. Accordingly, these SAO parameters are read from the bitstreamat step 1215. This step is similar to 1206 and is further described byreference to FIG. 14.

Following step 1212, when SAO parameters are determined for an entirerow, a test is performed at step 1216 to determine whether or not thecurrent component is the last component to be processed. If it is notthe last component to be processed, the algorithm is branched to step1209 to process the next component(s). Similarly, when the SAOparameters are determined for the current frame area, either by carryingout step 1214 or step 1215, the algorithm is branched to step 1216 todetermine whether or not the current component is the last component tobe processed. Again, if it is not the last component to be processed,the algorithm is branched to step 1209 to process the next component(s).

Otherwise, if all the components have been processed, a test isperformed at step 1217 to determine whether or not the last frame areahas been processed. If the last frame area has not been processed, theprocess is branched to step 1208 and the previous steps are repeated.Otherwise, the process ends.

At this stage, a set of SAO parameters, with the different parameterspresented by reference to FIG. 14, is associated with each frame areaand for each component.

FIG. 13 is a flow chart illustrating steps of a method for obtaining SAOparameters from a bitstream according to an LCU mode. Therefore, FIG. 13illustrates an alternative to encode the SAO parameters to the APS mode.More specifically, FIG. 13 illustrates how SAO parameters can be storedin a bitstream when the Largest Coding Unit (LCU) mode representation isused to associate a single set of SAO parameters per LCU. In order toavoid encoding one set of SAO parameters per LCU, which is costly, apredictive scheme can be used. In the given example, this predictivemode consists in checking if the LCU positioned on the left of thecurrent LCU uses the same SAO parameters. If not, a second check isperformed with the LCU positioned above the current LCU. This predictivetechnique enables a reduction in the amount of data to represent SAOparameters for the LCU mode. It is based on the use of dedicated flagsreferred to as Merge flags.

In step 1301 a loop is launched to handle successively each componentdenoted X. For the sake of illustration, images are still encodedaccording to the YUV scheme. Next, in step 1303 a flag denotedsao_merge_left_flag_X (wherein X stands for Y, U, or V) is read from thebitstream 1302 to be processed and decoded. If its value is true, theSAO parameters of the LCU positioned on the left of the current LCU areselected at step 1304 to be used for processing the current LCU. Morespecifically, this enables determination at step 1308 of the type of SAOloop filter to be applied on the current LCU.

Otherwise, if the read flag denoted sao_merge_left_flag_X is false, aflag denoted sao_merge_up_flag_X (wherein X stands for Y, U, or V) isread from the bitstream 1302 and decoded. If its value is true, the SAOparameters of the LCU positioned above the current LCU are selected atstep 1306 to be used for processing the current LCU. Again, this enablesdetermination at step 1308 of the type of SAO loop filter to be appliedon the current LCU.

Otherwise, if the read flag denoted sao_merge_up_flag_X is false, SAOparameters to be used for processing the current LCU are read anddecoded from bitstream 1302 at step 1307, the latter being described byreference to FIG. 14.

At this stage, SAO parameters for processing the current LCU areobtained and the type of SAO loop filter to be applied on the currentLCU is determined at step 1308.

Next, in step 1309 a test is performed to determine whether or not allcomponents Y, U, and V have been processed for the current LCU. If notall the components have been processed, the next component is selected,the algorithm is branched to step 1301, and the previous steps arerepeated.

Next, the next LCU can be processed similarly.

FIG. 14 is a flow chart illustrating steps of a method for reading SAOparameters in a bitstream. Accordingly, FIG. 14 illustrates the way SAOparameters are stored in an encoded bitstream.

In an initial step 1402, a flag denoted sao_type_idx_X (wherein X standsfor Y, U, or V) is read from the bitstream 1401 and decoded. Thecodeword that represents this syntax element can use a fixed length codeor any method of arithmetic coding.

As described above by reference to Table 1 of the Appendix, this syntaxelement makes it possible to determine the type of the SAO loop filterto be applied on the frame area to process component X. According to thegiven example, the flag sao_type_idx_X (or generically sao_type_idx) cantake one of five values that depends on the SAO loop filter to beapplied. As stated in Table 1 of the Appendix, 0 correspond to no SAOloop filter, 1 to 4 correspond to the 4 categories of Edge offset SAOloop filter as described by reference to Table 2 of the Appendix, andvalue 5 corresponds to the Band offset SAO loop filter.

A test is performed at step 1402, after having read and decoded the flagsao_type_idx_X, to determine whether or not the value of this index isstrictly positive. If the value of this index is equal to zero, whichmeans that no SAO loop filter is to be applied on the current framearea, the determination of the SAO parameters ends at step 1407.Otherwise, if the value of the flag sao_type_idx_X is strictly positive,SAO parameters exist in bitstream 1401 for the current frame area.

Next, a test is performed at step 1403 to determine whether or not thetype of the SAO loop filter to be applied is of the Band offset type(sao_type_idx_X==5). If the SAO loop filter to be applied is of the Bandoffset type, the position of the SAO band is read at step 1404 inbitstream 1401 and decoded.

After having read the position of the SAO band at step 1404, a loop islaunched at step 1405 for reading and decoding four Offset_(j) (jvarying from 1 to 4) at step 1406 from bitstream 1401. These fouroffsets correspond to the four offsets relating to the four ranges ofthe SAO Band offset as described by reference to FIG. 2.

Similarly, if the value of the flag sao_type_idx_X is positive anddifferent from 5, a loop is launched at step 1405 for reading anddecoding four Offset_(j) (j varying from 1 to 4) from bitstream 1401.These four offsets correspond to the four offsets of the four types ofSAO Edge offset as described by reference to Table 2 of the Appendix.

When the four offsets have been read and decoded at step 1406, thereading of the SAO parameters ends at step 1407.

According to a first main embodiment, some or all SAO parameters areshared between components. To that end, processes are defined to deriveSAO parameters from one component to another. Such dependencies betweencomponents can be defined for the two kinds of SAO classifications (Edgeand Band offsets).

As described previously by reference to FIG. 13, two flags denotedsao_merge_left_flag_X and sao_merge_up_flag_X are used in the currentimplementation of HEVC for the LCU mode so as to obtain SAO parametersas a function of previously processed SAO parameters. The flag denotedsao_merge_left_flag_X aims at specifying that the SAO parameters to beused for processing component X of the current LCU are those used forprocessing the same component of the LCU positioned on the left of thecurrent LCU. Similarly, the flag denoted sao_merge_up_flag_X aims atspecifying that the SAO parameters to be used for processing component Xof the current LCU are those used for processing the same component ofthe LCU positioned above the current LCU.

According to a particular embodiment, these flags are common for two orthree components of the current LCU. In other words, the flags of thesao_merge_left_flag and sao_merge_up_flag types are no longer used tospecify that the SAO parameters to be used for processing a component ofthe current LCU are those used for processing the same component ofanother LCU but to specify that the SAO parameters to be used forprocessing two or three components of the current LCU are those used forprocessing the same two to three components of another LCU. For the sakeof illustration, flags denoted sao_merge_left_flag_UV andsao_merge_up_flag_UV can be considered to specify that the SAOparameters to be used for processing U and V components of the currentLCU are those used for processing U and V components of the LCUpositioned on the left or above the current LCU, respectively.

According to another particular embodiment, flags are used to specifythat the SAO parameters to be used for processing two or threecomponents of the current LCU are those used for processing a componentof another LCU. As a consequence, a flag associated with a component ofthe current LCU can indicate which of the left or up LCU is to be usedas reference and, in that LCU, which of the components is to be used forobtaining SAO parameters. Therefore, the flags may be the followings:sao_merge_left_flag_Y, sao_merge_left_flag_U, sao_merge_left_flag_V,sao_merge_up_flag_Y, sao_merge_up_flag_U, and sao_merge_up_flag_V. Forthe sake of illustration, the SAO parameters of a component of thecurrent LCU that refers to the flag sao_merge_left_flag_V are the SAOparameters associated with component V of the LCU positioned on the leftof the current LCU.

In this embodiment, the SAO parameters associated with each component ofan LCU are preferably the same (for each component of this LCU) whenthey refer to those of another LCU. For the sake of illustration, theSAO parameters of all the components of the current LCU which acomponent refers to the flag sao_merge_left_flag_V are the SAOparameters associated with component V of the LCU positioned on the leftof the current LCU. Accordingly, the SAO parameters of the left Luma (Y)component can be used for filtering the Chroma (U) component of thecurrent LCU.

FIG. 15 is a flow chart illustrating steps of a method according to afirst embodiment of the invention for determining parameters to be usedin a loop filter for processing a current frame area. The example givenin FIG. 15 can be seen as a combination of the two particularembodiments described here above.

In step 1502 the flag denoted sao_merge_left_flag_Y is obtained frombitstream 1501 and a test is performed to determine whether or not thevalue of this flag is equal to one (i.e. if it is true). If the flagdenoted sao_merge_left_flag_Y is true, it is determined at step 1503that the SAO parameters to be used for filtering components Y, U, and Vof the current LCU are equal to the ones previously determined forfiltering component Y in the LCU positioned on the left of the currentLCU.

Accordingly, the value of the flags sao_type_idx_U and sao_type_idx_Vfor the current LCU, defining the type of the loop filter to be appliedon component U and V of the current LCU, are considered equal to that ofthe flag sao_type_idx_Y of the LCU positioned on the left of the currentLCU. Likewise, the other SAO parameters used for filtering components Uand V of the current LCU, for example offset values and, if needed, bandpositions (sao_band_position_U and sao_band_position_V) are obtainedfrom those of component Y of the LCU positioned on the left of thecurrent LCU.

Otherwise, if the flag denoted sao_merge_left_flag_Y is false, the flagdenoted sao_merge_up_flag_Y is obtained from bitstream 1501 and a testis performed to determine whether or not the value of this flag is equalto one (i.e. if it is true) at step 1504. If the flag denotedsao_merge_up_flag_Y is true, it is determined at step 1505 that the SAOparameters to be used for filtering components Y, U, and V of thecurrent LCU are equal to those previously determined for filteringcomponent Y in the LCU positioned above the current LCU.

Accordingly, the value of the flags sao_type_idx_U and sao_type_idx_Vfor the current LCU, defining the type of the loop filter to be appliedon components U and V of the current LCU, are considered equal to thatof the flag sao_type_idx_Y of the LCU positioned above the current LCU.Likewise, the other SAO parameters used for filtering components U and Vof the current LCU, for example offset values and, if needed, bandpositions (sao_band_position_U and sao_band_position_V) are obtainedfrom those of component Y of the LCU positioned above the current LCU.

Otherwise, if the flag denoted sao_merge_up_flag_Y is false, SAOparameters for component Y of the current LCU are extracted frombitstream 1501 at step 1511 as described above by reference to FIG. 14.In such a case, the value of the flags sao_type_idx_Y,sao_band_position_Y (if needed), and the four offsetj_Y are extractedfrom the bitstream 1501.

Next, if the flag denoted sao_merge_up_flag_Y is false, in step 1506 theflag denoted sao_merge_left_flag_UV is obtained from bitstream 1501 anda test is performed to determine whether or not the value of this flagis equal to one (i.e. if it is true). If the flag denotedsao_merge_left_flag_UV is true, it is determined at step 1507 that theSAO parameters to be used for filtering components U and V of thecurrent LCU are equal to those previously determined for filteringcomponents U and V, respectively, in the LCU positioned on the left ofthe current LCU.

Otherwise, if the flag denoted sao_merge_left_flag_UV is false, the flagdenoted sao_merge_up_flag_UV is obtained from bitstream 1501 and a testis performed to determine whether or not the value of this flag is equalto one (i.e. if it is true) at step 1508. If the flag denotedsao_merge_up_flag_UV is true, it is determined at step 1509 that the SAOparameters to be used for filtering components U and V of the currentLCU are equal to those previously determined for filtering components Uand V, respectively, in the LCU positioned above the current LCU.

Otherwise, if the flag denoted sao_merge_up_flag_UV is false, SAOparameters for components U and V of the current LCU are extracted frombitstream 1501 at step 1510 as described above by reference to FIG. 14.In such a case, the value of the flags sao_type_idx_U, sao_type_idx_V,sao_band_position_U (if needed), sao_band_position_V (if needed), thefour offsetj_U, and the four offsetj_V are extracted from bitstream1501. At this stage (reference 1512), all SAO parameters for allcomponents of the current LCU are available.

Next, in step 1513 the SAO loop filter is applied on all components ofthe current LCU and the decoding process goes to the next decoding step1314.

Still according to a particular embodiment, flags common to allcomponents of the current LCU, for example sao_merge_left_flag_YUV andsao_merge_up_flag_YUV flags, can be used. In such a case, if both flagsare false, flags directed to each component, generically referred to assao_merge_left_flag_X and sao_merge_up_flag_X (wherein X stands for Y,U, or V), can be used.

FIG. 16 is a flow chart illustrating steps of a method according to thefirst embodiment of the invention for determining parameters to be usedin a loop filter for processing a current frame area. The example givenin FIG. 16 is more specifically directed to the third particularembodiment described here above.

In step 1602 the flag denoted sao_merge_left_flag_YUV is obtained frombitstream 1601 and a test is performed to determine whether or not thevalue of this flag is equal to one (i.e. if it is true). If the flagdenoted sao_merge_left_flag_YUV is true, it is determined at step 1603that the SAO parameters to be used for filtering components Y, U, and Vof the current LCU are equal to those previously determined forfiltering component Y, U, and V, respectively, in the LCU positioned onthe left of the current LCU.

Accordingly, the value of the flags sao_type_idx_Y, sao_type_idx_U, andsao_type_idx_V for the current LCU, defining the type of the loop filterto be applied on components Y, U, and V of the current LCU, areconsidered equal to that of the corresponding flags of the LCUpositioned on the left of the current LCU. Likewise, the other SAOparameters used for filtering components Y, U and V of the current LCUare obtained from those of the corresponding component of the LCUpositioned on the left of the current LCU.

Otherwise, if the flag denoted sao_merge_left_flag_YUV is false, theflag denoted sao_merge_up_flag_YUV is obtained from bitstream 1601 and atest is performed to determine whether or not the value of this flag isequal to one (i.e. if it is true) at step 1604. If the flag denotedsao_merge_up_flag_YUV is true, it is determined at step 1605 that theSAO parameters to be used for filtering components Y, U and V of thecurrent LCU are equal to those previously determined for filteringcomponents Y, U and V, respectively, in the LCU positioned above thecurrent LCU.

Otherwise, if the flag denoted sao_merge_up_flag_YUV is false, the flagsassociated with each component of the current LCU, for determiningwhether or not SAO parameters are to be obtained as a function ofprevious processed SAO parameters, are decoded.

To that end, a loop is launched at step 1606 for processing sequentiallyeach component of the current LCU. For each component X (with X beingequal to Y, U, or V), the flag denoted sao_merge_left_flag_X isextracted from bitstream 1601 and a test is performed to determinewhether or not the value of this flag is equal to one (i.e. if it istrue) at step 1607. If the flag denoted sao_merge_left_flag_X is true,it is determined at step 1608 that the SAO parameters to be used forfiltering component X of the current LCU are equal to those previouslydetermined for filtering the same component in the LCU positioned on theleft of the current LCU.

Otherwise, if the flag denoted sao_merge_left_flag_X is false, the flagdenoted sao_merge_up_flag_X is obtained from bitstream 1601 and a testis performed to determine whether or not the value of this flag is equalto one (i.e. if it is true) at step 1609. If the flag denotedsao_merge_up_flag_X is true, it is determined at step 1610 that the SAOparameters to be used for filtering component X of the current LCU areequal to those previously determined for filtering the same component inthe LCU positioned above the current LCU.

Otherwise, if the flag denoted sao_merge_up_flag_X is false, SAOparameters for component X for the current LCU are extracted from thebitstream 1601 at step 1611.

Next, after having obtained SAO parameters for component X of thecurrent LCU, in step 1612 a test is performed to determine whether ornot component X is component V. If component X is not component V, theprocess is branched to step 1606 to process the next component.Otherwise, if component X is component V, SAO parameters are decoded andavailable for all the components of the current LCU at step 1613.

Next, in step 1614 the components of the current LCU are filtered in anSAO loop filter using the obtained SAO parameters and the decoder goesto the next decoding step at step 1615.

It is to be noted that the embodiments described by reference to FIGS.15 and 16 are based on the LCU syntax described by reference to FIG. 13.However, these embodiments can also be based on the SAO syntax for APSas described by reference to FIG. 12. In that particular case, theparameters shared between components are the SAO parameters as well asthe flags denoted unicity and repeat row and the syntax elements denotedsao_run_diff and sao_merge_up_flag.

As described above, in particular by reference to Table 1 of theAppendix, the syntax element or flag denoted sao_type_idx specifies thatthe current component of the current LCU is not processed when its valueis equal to zero. Otherwise, it specifies the SAO type. If the value ofthe flag sao_type_idx is equal to 1, 2, 3, or 4, the Edge offsetclassification is used to filter the current LCU and if the value of theflag sao_type_idx is equal to 5, the SAO Band offset is used to filterthe current LCU.

According to embodiments of the invention as described above, such flagsdenoted sao_type_idx can be shared between two or three components.

In another particular embodiment, components can share only some valuesof the flag denoted sao_type_idx. In other words, a second componentshares the value of the flag denoted sao_type_idx of a first componentonly if this value belongs to a predetermined set of values. Therefore,according to this embodiment, the value of the flag denoted sao_type_idxis conditionally shared.

For the sake of illustration, it can be assumed that the value of theflag denoted sao_type_idx associated with component Y is shared, for agiven LCU, with component U. However, it can be made possible that ifthis value indicates a SAO classification of Edge offset type (i.e.sao_type_idx=1, 2, 3, or 4), the direction of the Edge offset isnevertheless obtained from a bitstream part associated with component Uinstead of using the direction of the Edge offset classification asgiven by the component Y. If the value of the flag denoted sao_type_idx,associated with component Y is not equal to an Edge Offset(sao_type_idx=0 or 5), no direction information is extracted from thebitstream. In other words, if the SAO type for component Y is zero orfive, this SAO parameter (regarding the type) will be used by componentsU and V. However, if the SAO type is of the Edge offset type (i.e. valuefrom one to four) for component Y, dedicated SAO types will be used forcomponents U and V.

As described above, SAO parameters (associated with SAO loop filterusing pixel classification of the Edge offset type) comprise fouroffsets that are related to the four classes, out of the five possibleclasses. The first class (class “0”) corresponds to no SAO filtering. Itis to be recalled here that the direction of the Edge offsetclassification is signaled in the SAO type.

According to embodiments of the invention, these four offsets can beshared between two or three components when an Edge offset filter isselected for the current LCU, independently of the direction of Edgeoffset classification.

According to a first particular embodiment, the same offsets are usedfor two or three components. Consequently, only four offsets need to beextracted from a bitstream instead of eight or twelve if respectivelytwo or three components share the same four offsets, for filteringpixels with three components.

Naturally, such common offsets have to be computed at the encoder sidefor allowing processing of two or three components with the sameoffsets. As described below, this encoding choice is the same as the oneused for Band offset filtering.

In another particular embodiment, offsets Ozj associated with componentZ are derived from offsets Oxj of another component X according to aweighting factor βj as follows:Ozj=βjOxj

The weighting factor βj can be the same whatever the value of j is(β=βj) or not. The value of β or the values of βj can be predeterminedand constant or can be transmitted in particular headers like thesequence header or a slice header, or even transmitted LCU by LCU (ormore generally frame area by frame area).

When the values vary from one LCU to another, they can be dynamicallycomputed at the encoder and decoder sides.

The values of the weighting factors can be computed according to thefollowing formula:

$\beta_{j} = \frac{\sum\limits_{i = 0}^{N}{\max\left( {{{c_{i}^{Z} - c_{i\; n\; 1}^{Z}}},{{c_{i}^{Z} - c_{i\; n\; 2}^{Z}}}} \right)}}{\sum\limits_{i = 0}^{N}{\max\left( {{{c_{i}^{X} - c_{i\; n\; 1}^{X}}},{{c_{i}^{X} - c_{i\; n\; 2}^{X}}}} \right)}}$

where c_(i) ^(z) is the value of component Z of pixel i of class j andwhere c_(in1) ^(z) and c_(in2) ^(z) are the values of component Z of theneighbors of pixel i of class j as described above, in particular byreference to Table 2 of the Appendix.

Accordingly, the value of the weighting factor βj is the ratio betweenthe average (maximum) difference of component Z of the classified pixelsand their neighboring pixels and the average (maximum) difference ofcomponent X of the classified pixels and their neighboring pixels. Otherrelationships or formulas can be used to compute the values of theweighting factor βj (or of β).

Still in another particular embodiment, the value of the offsets encodedin a bitstream can depend on the values of the weighting factor βj (orβ), however they are determined. In such an embodiment, if the value ofthe weighting factor β or βj is less than one, the value of the offsetOzj is encoded in the bitstream instead of the value of the offset Oxj.

Indeed, in the formula Ozj=βj Oxj, Ozj<Oxj if βj<1. As a consequence,the offset value Ozj needs less bits to be encoded in the bitstream thanthe value of Oxj. Since, the decoder knows or can determine the valuesof the weighting factor βj, it can decode the value of Ozj from thebitstream and determine the value of Oxj according to the followingformula:Ozj=(1/βj)×Oxj

Still in a particular embodiment, the absolute value of the offsets Ozjassociated with a second component Z are equal to the absolute value ofoffsets Ox(5−j) associated with a first component X. It is to be notedhere that according to this particular embodiment, only the absolutevalue is used since the sign of the offset for Edge offset class ispredetermined to reduce artifacts.

FIG. 17 illustrates such a particular embodiment according to which thevalues of the offsets associated with a component correspond to themirrored values of the offsets associated with a second component. Asillustrated, the offset for the 4 classes of component Z are derivedfrom offsets from component X by considering the inverse order of theoffsets. It is to be recalled here that signs applied to offsets arededuced from the classification.

Still in another particular embodiment, the mirrored values of offsetsassociated with a first component used as offsets associated with asecond component can be weighted with weighting factors βj. According tothis particular embodiment, the absolute value of the offsets Ozjassociated with a second component Z are equal to the weighted absolutevalue of the offsets Ox(5−j) associated with a first component Xaccording to the following formula:Ozj=βjOx(5−j)

As described above, the SAO Band offset filter needs two types ofparameters. The first type is directed to a position (sao_band_position)and the second type is directed to the four offsets relating to the fourclasses of the band that is defined from the given position. Accordingto embodiments of the invention, the two types of parameters associatedwith components of a frame area may be obtained separately from thecorresponding parameters associated with components of another framearea already processed. However, the embodiments that relate to theposition (sao_band_position) and those that relate to the offsets can beeasily combined. Moreover, as described previously by reference to theEdge offset embodiments, these embodiments or combinations ofembodiments that relate to positions and offsets for Band offsetfiltering are applied as a function of the values of Merge flags or ofthe SAO syntax for APS, as described above.

It is to be noted that as SAO parameters associated with a component canbe used to process two or three components, the following descriptionfocuses on the use of SAO parameters associated with one component forprocessing two components for the sake of illustration.

FIG. 18 illustrates how values of offsets associated with a secondcomponent Z can be obtained from values of offsets associated with afirst component X when applying an SAO loop filter using a Band offsetclassification.

Reference 1801 illustrates the use of SAO parameters, in particular ofoffsets associated with components for applying an SAO loop filter usinga Band offset classification, according to the current HEVCspecifications. The offsets associated with each component are allencoded in the bitstream used for transmitting the encoded images. Forthe sake of illustration, the bitstream comprises offsets Ox1 to Ox4,generically referred to as Oxj, associated with a first component X andoffsets Oz1 to Oz4, generically referred to as Ozj, associated with afirst component Z. As illustrated by reference 1801, offsets Oxjcorrespond to a first band comprising four consecutive classes denotedBO X and offsets Ozj correspond to a second band, also comprising fourconsecutive classes, denoted BO Z.

Reference 1802 shows a first particular embodiment where offsets Ozj areequal to offsets Oxj. Therefore, offset Ozj are not encoded in thebitstream. They can be recovered by using corresponding Merge flags asdescribed above by reference to Edge offset filtering. Similarly, aweighting factor β or βj can be used so that offsets Ozj can bedetermined as a function of offsets Oxj (Ozj=βj Oxj). Again, the valueor values of weighting factor β or βj can be predetermined orrepresented at different levels in the bitstream (at sequence level,frame level, slice level, or LCU level). In this context, the value orvalues of weighting factor β or βj can be negative (for Edge offset, thesign of the offsets is determined as a function of the class). Inparticular, the weighting factor can be equal to minus one (β=−1).

Still in another particular embodiment, the value or values of theweighting factor β or βj can be determined dynamically. For the sake ofillustration, the value or values of the weighting factor β or βj can bedetermined as a function of the position of the band(sao_band_position). For example, if class j of band Z and class j ofband X are not in the same sub intervals in view of the center of theinterval (represented in bold line in FIG. 18) β=−1 otherwise β=1. It isconsidered here that the full interval is split into two sub intervals,the first one being the interval of pixel values from 0 to 127 and thesecond one being the interval of pixel values from 128 to 256 (when 8bit depth is used for pixel value).

According to another embodiment, the values of weighting factor βj aredetermined as a function of the ratio between the distance of thecurrent class of component Z (or the set of classes for the value ofweighting factor β) to the center of the interval and the distancebetween the current class of component X (or the set of classes for thevalue of weighting factor β) to the center of the interval, which can beexpressed as follows:

$\beta_{j} = \frac{{{sao\_ band}{\_ position}{\_ Z}_{j}} - 16}{{{sao\_ band}{\_ position}{\_ X}_{j}} - 16}$

where sao_band_position_Z_(j)−16 is the distance between the currentcomponent Z and the center of the interval andsao_band_position_X_(j)−16 is the distance between the current componentX and the center of the interval. In another embodiment, the inverseratio could be considered. As for Edge offset, other relationships andformulas can be used to determine the value or values of the weightingfactor β or βj. Moreover, as described above, offsets Oxj or offsets Ozjcan be inserted in the bitstream depending upon the value or values ofthe weighting factor β or βj (however they are determined) in order toreduce the number of bits needed to encode offsets Oxj or offsets Ozj.

Reference 1803 illustrates how mirrored values of offsets associatedwith a first component can be used as values of offsets associated witha second component for the Band offset filtering. As described above byreference to the Edge offset filtering, the relationships betweenoffsets Ozj and Oxj can be expressed by the following formula:Ozj=Ox(5−j)

Again, this particular embodiment can be combined with the use ofweighting factor according to the formula Ozj=βj Ox(5−j). In aparticular embodiment, βj is equal to −1.

A specific derivation of the offsets for the Band offset filtering isthe increase or decrease of the size of the classes enablingmodification of pixel Band offset classification. Reference 1604illustrates an example of such a classification adaptation. According tothe illustrated example, the number of pixels per class is divided bytwo for component Z compared to the band classification for component X.Therefore, pixel classification for component Z, according to Bandoffset filtering, requires checking of six bits. In other words, the sixmost significant bits have to be checked for classifying a pixel.Therefore, it may be considered that the full pixel value interval isdivided into 64 ranges for component Z.

This relationship can be fixed for the implementation or can be signaledat the sequence, frame, slice, or LCU level. It can be determineddynamically by taking into account the ratio of the pixel range size forcomponent X and the pixel range size for component Z at LCU level (orsequence, frame, or slice). Accordingly, the size of the classes forcomponent Z can be determined as follow:

${{size}({class\_ Z})} = {\frac{{\max\left( P_{zi} \right)} - {\min\left( P_{zi} \right)}}{{\max\left( P_{xi} \right)} - {\min\left( P_{xi} \right)}}{{size}({class\_ X})}}$

for all i=0 to N, where Pzi are the pixels of component Z and Pxi arethe pixels of component X. To simplify the band classification, thenumber of pixel values per class is equal to a power of two (allowingbit checking of most significant bits).

This particular embodiment can be combined with all other particularembodiments described for the derivation of offsets of the Band offsetas illustrated by reference 1805 where this embodiment is combined withthe use of mirrored value offsets associated with component X.

In another particular embodiment that is applicable to both SAO Edge andBand filtering, the offsets from one component can be derived from twoor three components.

All described embodiments applicable to both SAO Edge and Bandfiltering, that relate to the use of offsets from one component todetermine (or derive) the offsets for one or two other components,present advantages, in particular regarding the size of the requestedmemory buffer when such a derivation is systematically used (for allLCUs) since the offsets of the second component and/or third componentdo not need to be stored.

In another particular embodiment (for both SAO Edge and Band filtering),the offsets derivation between components can be used to predict theoffsets from a second component according to the offsets from a firstcomponent. (The description is dedicated to sharing offsets betweencomponents). In this embodiment, the residuals of the offsets ofcomponent Z are encoded in the bitstream instead of encoding directlythe offsets value of component Z. At the decoder side the offsets ofcomponent Z are obtained by adding residual offsets to the offsets ofcomponent X.

In another particular embodiment applicable to both SAO Edge and Bandoffset filtering, the offsets derivation between components can be usedas a context for the context arithmetic coding of the offsets associatedwith a second component according to the offsets associated with a firstcomponent.

Still in another particular embodiment applicable to both SAO Edge andBand filtering, the offsets derivation between two components can besignaled in the bitstream and can be in competition with theconventional mode whereby the offsets are encoded in the bitstream forall the components.

As described above, a band position (sao_band_position) is the positionof the first class of a band in the full pixel value intervals. Byconsidering a standard five bits checking, the value of thesao_band_position parameter belongs to the range [0; 32]. According toembodiments of the invention, this parameter can be shared between twoor three components. For the sake of illustration, the descriptionfocuses on the derivation of this parameter regarding a component Z fromits value associated with a component X.

FIG. 19 illustrates how a value of the sao_band_position parameterassociated with a second component Z can be obtained from the value ofthe sao_band_position parameter associated with a first component X whenapplying an SAO loop filter using a Band offset classification.

Reference 1901 illustrates an example of two sao_band_position valuesthat are transmitted in the bitstream according to the current HEVCspecifications.

In a particular embodiment illustrated by reference 1902, a commonsao_band_position value is used for both component Z and component X.

In particular embodiments, the center position of a band is compared tothe center of the full pixel interval. The resulting value is equal tosao_band_position−14 (14 corresponding to the center of the interval(16) minus the center of the band (−2)).

Accordingly, in a particular embodiment illustrated by reference 1903,the sao_band_position_Z associated with component Z is defined as beingsymmetrical to the sao_band_position_X associated with component X withrespect to the center of the full pixels interval. Therefore,(sao_band_position_Z−14) is deemed to be equal to−(sao_band_position_X−14). Since sao_band_position_X is equal to six inthis example, sao_band_position_Z is thus equal to twenty two(−(6−14)+14=22).

Still in a particular embodiment illustrated by reference 1904, aweighting factor β is used to determine the sao_band_position_Z valueassociated with component Z as a function of the sao_band_position_Xvalue associated with component X and of the position of the center ofthe full pixel interval. This is based, as in the previous embodiment,on the relative position between the center of the full pixel intervaland the sao_band_position value of each component X and Z. According tothis example, the relationship to be used can be the followingsao_band_position_(—) Z−14=β(sao_band_position_(—) X−14)that is to saysao_band_position_(—) Z=β(sao_band_position_(—) X−14)+14

In the example given in FIG. 19, β=−½. In that case sao_band_position_Xis equal to 6 and consequently sao_band_position_Z is equal to eighteen(−½(6−14)+14=18).

The value of the weighting factor β can be predetermined for theimplementation or transmitted at any level (sequence, frame, slice, orLCU).

Still in another particular embodiment applicable to both SAO Edge andBand filtering, the derivation of the sao_band_position parameterbetween two components can be signaled in the bitstream and be incompetition with the conventional mode in which the sao_band_positionparameter value is encoded in the bitstream for all the components.

The encoding selection of SAO parameters when SAO parameters are sharedbetween two or three color components preferably relates to codingefficiency. In other words, selecting shared SAO parameters takesadvantageously into account the coding efficiency of these parametersand associated values. It is to be recalled here that the selection ofthe best offset in terms of rate distortion cost is the same for bothEdge and Band offset filtering.

The encoding selections of offsets when these offsets are shared betweentwo components Z and X, whatever the SAO type (Edge of Band) used isdescribed herein below before the band center selection.

As described by reference to FIG. 3 illustrating the encoding processfor determining an optimal offset in terms of distortion for onecomponent, the SumXj and SumNbPixXj values related to component X andthe SumZj and SumNbPixZj values related to component Z are known for allclasses j. SumXj and SumZj are the sums of differences between the pixelvalues in the class j and their original values for respectivelycomponents X and Z. SumNbPixXj and SumNbPixZj are the number of pixelsin class j for respectively X and Z components. It is assumed that thevalues of these four parameters have already been computed for allclasses.

In the particular embodiment according to which to which an object is toget Ozj=Oxj, the optimal offset Ooptj can be determined by the followingformula:Ooptj=Ozj=Oxj=(SumXj+SumZj)/(SumNbPixXj+SumNbPixZj)

Next, as described above for processing each component independently,the encoder determines the best offset Oxj in terms of rate distortioncriterion.

This consists, with the particular embodiment according to whichOzj=Oxj, in minimizing the rate distortion cost as follows:J(Oxj,Ozj)=SumNbPixXj×(Oxj×Oxj)−SumXj×Oxj×2+SumNbPixZ(j)×(Oxj×Oxj)−SumZ(j)×Oxj×2+λR(Oxj)

that can be simplified according to the following expression:J(Oxj,Ozj)=(SumNbPixXj+SumNbPixZj)×(Oj×Oj)−(SumXj+SumZj)×Oj×2+λR(Oj)

In the particular embodiment according to which mirrored values aretargeted to determine offsets (Ozj=−OX(5−j)) for the Edge offset case,the optimal offset can be defined by the following formula:Ooptj=Oz(5−j)=Oxj=(SumXj−SumZ(5−j))/(SumNbPixXj+SumNbPixZ(5−j))

Next, the encoder determines a best offset Oxj in terms of ratedistortion criterion. This consists, according to the particularembodiment according to which Oz(5−j)=−Oxj, in minimizing the ratedistortion cost as follows:J(Oxj,Ozj)=SumNbPixXj×(Oxj×Oxj)−SumXj×Oxj×2+SumNbPixZ(5−j)×(Oz(5−j)×Oz(5−j))−SumZ(5−j)×Oz(5−j)×2+λR(Oxj)orJ(Oxj,Ozj)=SumNbPixXj×(Oxj×Oxj)−SumXj×Oxj×2+SumNbPixZ(5−j)×(Oxj×Oxj)+SumZ(5−j)×Oxj×2+λR(Oxj)

In the particular embodiment according to which Ozj=−Oxj, the optimaloffset Ooptj is determined by the following formula:Ooptj=(SumXj−SumZj)/(SumNbPixXj+SumNbPixZj)

Next, the encoder determines a best offset Oxj in terms of ratedistortion criterion. This consists, according to the particularembodiment according to which Ozj=−Oxj, in minimizing the ratedistortion cost as follows:J(Oxj,Ozj)=SumNbPixXj×(Oxj×Oxj)−SumXj×Oxj×2+SumNbPixZ(j)×(Ox(j)×Ox(j))+SumZ(j)×Ox(j)×2+λR(Oxj),that can be simplified by the following expression:J(Oxj,Ozj)=(SumNbPixXj+SumNbPixZj)×(Oxj×Oxj)−(SumXj−SumZj)×Oxj×2+λR(Oxj)

In the particular embodiment according to which Ozj=βj Oxj, the encoderdetermines independently an optimal OoptXj value for component X and anoptimal OoptZj value for component Z. Next, the encoder determines abest offset Oxj in terms of rate distortion criterion. This consists,according to the particular embodiment Ozj=βj Oxj, in minimizing therate distortion cost as described by reference to FIG. 4.

FIG. 20 is a flow chart illustrating steps of a method for determiningan optimal offset to be used by two or three components according to arate distortion criterion. The process illustrated in FIG. 20 is basedon the one described by reference to FIG. 4. Steps 2001, 2004, 2005, and2006 are similar to steps 401, 404, 405, and 406, respectively.

Step 2002 differs from step 402 in that the loop launched at step 2002makes offset Oxj varying from sign(OoptXj)×max(f×OoptXj, OoptZj) to zerowhere f is equal to 1/β_(j) if β_(j)<1 and to β_(j) otherwise.

In the generalized embodiment in which Ozj=βj Oxj, the rate distortioncriterion is computed according to the following formula:J(Oxj,Ozj)=SumNbPixXj×(Oxj×Oxj)−SumXj×Oxj×2+SumNbPixZ(j)×(βj×Oxj×βj×Oxj)−SumZ(j)×βj×Oxj×2+λR(Oxj)that can be also written as follows:J(Oxj,Ozj)=(SumNbPixXj+SumNbPixZ(j)×(βj)×(βj)×(Oxj×Oxj)−(SumXj+SumZ(j)×βj)×Oxj×2+λR(Oxj)

In step 2003, the particular case where βj=−1 is considered the for sakeof illustration.

The selection of an sao_band_position value shared between twocomponents X and Z can be determined according to the followingrelationships:sao_band_position_(—) Z=β(sao_band_position_(—) X−14)+14

FIG. 21 is a flow chart illustrating steps of a method for determiningan SAO band position shared between two components. It is based on theprocess described by reference to FIG. 5. The process illustrated inFIG. 21 aims at determining the value of sao_band_position_Z associatedwith component Z from the value of sao_band_position_X associated withcomponent X.

The main difference between the process illustrated in FIG. 21 and theone illustrated in FIG. 5 relates to module 2105 where both ratedistortion values of classes associated with component Z and classesassociated with component X are added together according to thefollowing formula:J′i=J′i+JZj+JXjx

where JZj is the rate distortion value for class j of the component Zand JXjx is the rate distortion value for class j of the component X.Moreover to select jointly the sao_band_position_Z withsao_band_position_X, the index jx is derived according the followingformula:sao_band_position_(—) Z=β(sao_band_position_(—) X−14)+14

Accordingly, jx is equal to β(j−14)+14

According to a second main embodiment that avoids componentclassification in order to reduce the decoding complexity, the pixels inan SAO class are determined as a function of a single component. Thepixel positions are then used to determine the component or componentswhich need to be filtered. Accordingly, if a pixel component is to befiltered according to that component, another component or the two othercomponents of that pixel are filtered.

FIG. 22 is a flow chart illustrating steps of a method for decoding abitstream according to a particular embodiment of the invention. Theprocess illustrated in this figure is based on the one illustrated inFIG. 6. It aims at using the classification of component X to filtercomponent Z.

An initial step 2201 consists in determining SAO parameters according tothe processes described by reference to FIGS. 12, 13, and 14. However,according to the algorithm illustrated in FIG. 22, only the value of thesao_type_idx parameter and, if it is equal to five, the value of thesao_band_position parameter for component X are determined at step 2202from the bitstream (not represented). Indeed, these parameters beingrelated to the classification, they are not needed to classify componentZ which is filtered according to the classification of component X.

Next, in step 2203 the four offsets associated with component X areobtained from the bitstream. Similarly, the four offsets associated withcomponent Z are obtained from the bitstream at step 2204. It is to benoted that these offsets can be determined as a function of otheroffsets associated with other components and/or with another LCU asdescribed above.

In step 2205, the counter variable i is set to the value zero. Next, thefirst pixel Px_(i) of the frame area of component X (reference 2206),comprising N pixels, is extracted at step 2207. Similarly, the firstpixel Pz_(i) of the frame area of component Z (reference 2208) isextracted at step 2209. For the sake of illustration, it is admittedhere that the frame area of component Z contains also N pixels(components X and Z have the same amount of pixels per frame area).

Next, in step 2210, component X of the first pixel Px_(i) is classifiedaccording to the Edge offset classification or Band offsetclassification thanks to the value of the sao_type_idx_X parameter (andif needed the value of the sao_band_position_X parameter) as describedpreviously by reference to Table 2 of the Appendix and FIG. 2,respectively.

In step 2211, a test is performed to determine whether or not componentX of pixel Pxi is to be filtered (i.e. if Pxi belongs to an SAO class).If Pxi belongs to an SAO class, the related class number j is identifiedand the corresponding offset value is obtained at step 2212 from theoffsets table associated with component X. Next, in step 2213, componentX of pixel Pxi is filtered by adding the obtained offset to its value.The filtered component X of pixel Pxi is referred to as P′xi (reference2214). Simultaneously or sequentially, the offset value associated withcomponent Z and corresponding to class number j is obtained at step 2215from the offsets table associated with component Z. Next, in step 2216,component Z of pixel Pzi is filtered by adding the obtained offset toits value. The filtered component Z of pixel Pzi is referred to as P′zi(reference 2217).

Next, in step 2218, the filtered components P′xi and P′zj are put incomponent X and component Z of the filtered frame area, referred to as2219 and 2220, respectively. In step 2218, filtered pixels P′xi and P′zjrespectively replace pixels Pxi and Pzj of the processed frames referredto as 2219 and 2220.

If Pxi does not belong to an SAO class, components Pxi and Pzj incomponent X and component Z of the filtered frame areas remain unchangedat steps 2221, 2222, and 2218.

Next, at step 2223, the counter variable i is incremented by one inorder to apply the filter process similarly to the next pixels of thecurrent frame area.

In step 2224, it is determined whether or not all the N pixels of thecurrent frame area have been processed (i≧N). If yes, the filteredcomponents X and Z of the frame area are reconstructed and can be addedto the SAO reconstructed frame.

FIG. 22 illustrates the use of SAO classification of one component X tofilter similarly another component Z when both components have the samenumber of pixels for the current frame area.

However, components of a frame area do not always have the same numberof pixels. Depending on the relative number of pixels for component X,denoted Nx regarding the number of pixels for component Z, denoted Nz,two cases can be considered. Since the difference between the numbers ofpixels of two different components in a frame area is typically amultiple of two, it is generally not necessary to take into accountnon-integer relationships between pixel component numbers.

Considering the case according to which the number of pixels ofcomponent Z is greater than the number of pixels of component X (Nx<Nz),the algorithm described by reference to FIG. 22 can be easily adapted byconsidering that Pzi is a group of Nz/Nx pixels. Accordingly, when anoffset OffsetZi is added to a group of pixels Pzi, this offset isapplied to all pixels of the group of pixels Pzi. Moreover, in aparticular embodiment, it can be considered that the offset OffsetZi isa group of offsets of the same size as the group of pixels Pzi.

Considering the case according to which the number of pixels ofcomponent X is greater than the number of pixels of component Z (Nx>Nz),several embodiments can be considered. In such a case, steps 2216 and2218 described by reference to FIG. 22 need to take into account therelationship between the number of pixels of component X and the numberof pixels of component Z. In FIG. 22, Pzi is changed by Pz(i/Nx).

In a first particular embodiment, the offset OffsetZi is added to thegroup Pz(i/Nx) only if Pxi have been filtered at least once.

According to another particular embodiment, step 2218 of FIG. 22 takesinto account the number of times that Pxi have been filtered. If it isgreater than 2xNx/Nz then OffsetZi is added to Pz(i/Nx).

Still according to a particular embodiment, step 2218 receives Nx/Nztimes, Pz(i/Nx) or P′z(i/Nx) and it computes the average in order toproduce the pixel value put in filtered frame area for component Z(2220).

FIG. 23 illustrates the use of SAO classification of one component X tosimilarly filter another component Z.

For the sake of illustration, the greyed pixels of the block 2301represent pixels filtered for an SAO loop filter of type i of thecurrent class j for the component X according to the currentimplementation HEVC. Similarly, the black pixels of the block 2302represent pixels filtered for an SAO loop filter of type i of thecurrent class j for the component Z according to the current HEVCspecifications.

Therefore, as illustrated in FIG. 23, the greyed pixels in component Xand the black pixels in component Z are not always at the same positionconsidering the current HEVC specifications.

Still for the sake of illustration, the greyed pixels of the block 2303represent pixels filtered for an SAO loop filter of type i of thecurrent class j for the component X according to the currentimplementation HEVC. However, the blackened pixels of the block 2304represent pixels filtered for an SAO loop filter for the component Zaccording to the classification of component X (block 2303).Accordingly, the greyed pixels and the blackened pixels are located atthe same positions. This results of the use of only one classificationfor both components.

It is to be noted that both main embodiments can be combined to optimizecoding efficiency and decoding complexity.

Although the present invention has been described hereinabove withreference to specific embodiments, the present invention is not limitedto the specific embodiments, and modifications will be apparent to askilled person in the art which lie within the scope of the presentinvention. In particular, while the previous description refers to YUVcomponents, for the sake of illustration, other schemes like RGB (Red,Green and Blue components) can be used.

For example, while the previous embodiments have been described inrelation to pixels of an image and their corresponding pixel values, itwill be appreciated that, within the context of the invention, a groupof pixels may be considered together with a corresponding group pixelvalue. A sample may thus correspond to one or more pixels of an image.

Further aspects of the present invention are set out below.

According to a first further aspect of the invention there is provided amethod of encoding at least a part of an image comprising a plurality ofsamples, each sample comprising at least two components, the encodedimage comprising at least one filtering parameter, the method comprising

encoding a first and a second component of at least one sample of theimage to provide at least one encoded sample;

decoding the at least one encoded sample;

computing the at least one filtering parameter as a function of thedifference between at least one component of the at least one sample ofthe image and the at least one corresponding component of the at leastone corresponding decoded sample, the at least one filtering parameterbeing computed so as to be used in a loop filter to filter independentlyat least a first and a second component of a decoded sample.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

In an embodiment the at least one filtering parameter is determined as afunction of a plurality of estimated filtering parameters so that theefficiency of coding the at least one filtering parameter is an optimum.

In an embodiment the at least one filtering parameter is determined as afunction of the differences between at least a component of samples of apart of the image and the at least one corresponding component of thecorresponding decoded samples, of the number of samples of the at leastone component in the part of the image, and of values of two componentsof the samples of the part of the image.

In an embodiment the at least one filtering parameter is determined as afunction of a first filtering parameter computed as a function of thedifference between a first component of the at least one sample of theimage and the corresponding first component of the at least onecorresponding decoded sample and of a second filtering parametercomputed as a function of the difference between a second component ofthe at least one sample of the image and the corresponding secondcomponent of the at least one corresponding decoded sample.

In an embodiment the first and second filtering parameters are computedas a function of a plurality of samples of a part of the image.

In an embodiment the at least one filtering parameter comprises at leastone offset to be added to a sample component to be filtered.

In an embodiment the at least one filtering parameter further comprisesat least one weighting factor for weighting the at least one offset.

In an embodiment the at least one filtering parameter further comprisesat least one position of a band which defines at least one class ofsample components to be filtered.

In an embodiment the method further comprises a step of determining theat least one position as a function of different rate distortion valuesestimated for different components.

Still in an embodiment the at least one filtering parameter furthercomprises at least one flag associated with at least a first componentof a first sample, the at least one flag being indicative of a referenceto at least one filtering parameter associated with at least a secondcomponent of a second sample, for filtering the at least a firstcomponent.

In an embodiment the at least one filtering parameter further comprisesat least one flag associated with at least a first component of a firstsample, the at least one flag being indicative of a reference to atleast one filtering parameter associated with at least a secondcomponent of a second sample, for filtering a plurality of components ofthe first sample.

According to a second further aspect of the invention there is provideda method of decoding at least a part of an image comprising a pluralityof samples, each sample comprising at least two components, the encodedimage comprising at least one filtering parameter, the method comprising

decoding a first and a second component of at least one encoded sampleto provide a first and a second component of at least one reconstructedsample;

decoding the at least one filtering parameter;

filtering the at least one reconstructed sample in a loop filter, thefiltering of the first component and of the second component of the atleast one reconstructed sample being based on at least one commonfiltering parameter of the decoded at least one filtering parameter.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

In an embodiment the method further comprises a step of obtaining aleast one flag indicatives of a reference to the at least one filteringparameter.

In an embodiment the method further comprises a step of analysing theobtained at least one flag and, in response to the analysis, obtainingthe at least one common filtering parameter.

Still in an embodiment the method further comprises a step of obtainingat least another flag indicatives of a reference to at least onefiltering parameter and a step of analysing the obtained at leastanother flag, the step of obtaining a least one flag being carried outin response to the step of analysing the obtained at least another flag.

In an embodiment the method further comprises a step of computing afiltering parameter to be used for filtering at least the firstcomponent of the at least one reconstructed sample as a function of thedecoded at least one filtering parameter.

In an embodiment the method further comprises a step of computing afiltering parameter to be used for filtering the first and secondcomponents of the at least one reconstructed sample as a function of thedecoded at least one filtering parameter.

Still in an embodiment the method further comprises a step of obtainingat least one weighting factor, the computed filtering parameter beingbased on the obtained at least one weighting factor.

In an embodiment the method further comprises a step of decoding the atleast one weighting factor, the at least one weighting factor beingreceived along with the part of the image to be decoded.

In an embodiment the common filtering parameter comprises at least oneoffset value to be added to at least the first component of the at leastone reconstructed sample.

In an embodiment the common filtering parameter comprises at least oneposition of a band which defines at least one class of sample componentsto be filtered.

Still in an embodiment the method further comprises a step of obtainingat least one weighting factor to applied on the at least one position ofthe band for filtering at least the first component of the at least onereconstructed sample.

According to a third further aspect of the invention there is provided amethod of encoding at least a part of an image comprising a plurality ofsamples, each sample comprising at least two components, the encodedimage comprising at least one filtering parameter, the method comprising

encoding a first and a second component of at least one sample of theimage to provide at least one encoded sample;

decoding the at least one encoded sample;

computing the at least one filtering parameter as a function of thedifference between a component of the at least one sample of the imageand the corresponding component of the at least one decoded sample, theat least one filtering parameter being computed so as to be used in aloop filter to filter independently at least a first and a secondcomponent of a decoded sample.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

According to a fourth further aspect of the invention there is provideda method of decoding at least a part of an image comprising a pluralityof samples, each sample comprising at least two components, the encodedimage comprising at least one filtering parameter, the method comprising

decoding a first component of a first encoded sample and a secondcomponent of a second encoded sample to provide a first component of afirst reconstructed sample and a second component of a secondreconstructed sample;

decoding the at least one filtering parameter;

filtering reconstructed samples in a loop filter, the filtering of thefirst component of the first reconstructed sample and of the secondcomponent of the second reconstructed sample being based on at least onecommon filtering parameter of the decoded at least one filteringparameter.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

In an embodiment the method further comprises a step of computing afiltering parameter to be used for filtering the first component of theat least one reconstructed sample as a function of a filtering parameterto be used for filtering the second component of the at least onereconstructed sample.

In an embodiment a first plurality of filtering parameters areassociated with the first component of the first reconstructed sampleand a second plurality of filtering parameters are associated with thesecond component of the second reconstructed sample, the filteringparameter values of the first plurality of filtering parameters beingequal to the filtering parameter values of the second plurality offiltering parameters and the filtering parameter values of the firstplurality of filtering parameters being in inverse order to the order ofthe filtering parameter values of the second plurality of filteringparameters.

In another embodiment a first plurality of filtering parameters areassociated with the first component of the first reconstructed sampleand a second plurality of filtering parameters are associated with thesecond component of the second reconstructed sample, the filteringparameter values of the first plurality of filtering parameters beingequal to the filtering parameter values of the second plurality offiltering parameters multiplied by a predetermined weighting factor.

According to a fifth further aspect of the invention there is provided acomputer program product for a programmable apparatus, the computerprogram product comprising a sequence of instructions for implementingeach step of the method embodying one of the first to fourth furtheraspects described above when loaded into and executed by theprogrammable apparatus.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

According to a sixth further aspect of the invention there is provided acomputer-readable storage medium storing instructions of a computerprogram for implementing each step of the method embodying one of thefirst to fourth further aspects described above.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

According to a seventh further aspect of the invention there is providedan encoding device for encoding at least a part of an image comprising aplurality of samples, each sample comprising at least two components,the encoded image comprising at least one filtering parameter, theencoding device comprising

means for encoding a first and a second component of at least one sampleof the image to provide at least one encoded sample;

means for decoding the at least one encoded sample;

means for computing the at least one filtering parameter as a functionof the difference between at least one component of the at least onesample of the image and the at least one corresponding component of theat least one corresponding decoded sample, the at least one filteringparameter being computed so as to be used in a loop filter to filterindependently at least a first and a second component of a decodedsample.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

In an embodiment the device further comprises means for encoding flags,the at least one filtering parameter further comprising at least oneflag associated with at least a first component of a first sample, theat least one flag being indicative of a reference to at least onefiltering parameter associated with at least a second component of asecond sample, for filtering the at least a first component.

In another embodiment the device further comprises means for encodingflags, the at least one filtering parameter further comprising at leastone flag associated with at least a first component of a first sample,the at least one flag being indicative of a reference to at least onefiltering parameter associated with at least a second component of asecond sample, for filtering a plurality of components of the firstsample.

According to an eighth further aspect of the invention there is provideda decoding device for decoding at least a part of an image comprising aplurality of samples, each sample comprising at least two components,the encoded image comprising at least one filtering parameter, thedevice comprising

means for decoding a first and a second component of at least oneencoded sample to provide a first and a second component of at least onereconstructed sample;

means for decoding the at least one filtering parameter;

means for filtering the at least one reconstructed sample in a loopfilter, the filtering of the first component and of the second componentof the at least one reconstructed sample being based on at least onecommon filtering parameter of the decoded at least one filteringparameter.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

In an embodiment the device further comprises means for obtaining aleast one flag indicatives of a reference to the at least one filteringparameter, means for obtaining at least another flag indicatives of areference to at least one filtering parameter, and means for analysingthe obtained at least another flag, the means for obtaining a least oneflag being responsive to the means for analysing the obtained at leastanother flag.

In an embodiment the device further comprises means for computing afiltering parameter to be used for filtering at least the firstcomponent of the at least one reconstructed sample as a function of thedecoded at least one filtering parameter.

Still in an embodiment the device further comprises means for computinga filtering parameter to be used for filtering the first and secondcomponents of the at least one reconstructed sample as a function of thedecoded at least one filtering parameter.

According to a ninth further aspect of the invention there is providedan encoding device for encoding at least a part of an image comprising aplurality of samples, each sample comprising at least two components,the encoded image comprising at least one filtering parameter, thedevice comprising

means for encoding a first and a second component of at least one sampleof the image to provide at least one encoded sample;

means for decoding the at least one encoded sample;

means for computing the at least one filtering parameter as a functionof the difference between a component of the at least one sample of theimage and the corresponding component of the at least one decodedsample, the at least one filtering parameter being computed so as to beused in a loop filter to filter independently at least a first and asecond component of a decoded sample.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

According to a tenth further aspect of the invention there is provided adecoding device for decoding at least a part of an image comprising aplurality of samples, each sample comprising at least two components,the encoded image comprising at least one filtering parameter, thedevice comprising

means for decoding a first component of a first encoded sample and asecond component of a second encoded sample to provide a first componentof a first reconstructed sample and a second component of a secondreconstructed sample;

means for decoding the at least one filtering parameter;

means for filtering reconstructed samples in a loop filter, thefiltering of the first component of the first reconstructed sample andof the second component of the second reconstructed sample being basedon at least one common filtering parameter of the decoded at least onefiltering parameter.

By taking into account the interdependencies between components, theinvention makes it possible to improve the coding efficiency of SAO, toreduce the memory buffer needed to store SAO parameters, and to reducethe complexity of the classification.

In an embodiment the device further comprises means for computingfiltering parameters, wherein a first plurality of filtering parametersare associated with the first component of the first reconstructedsample and a second plurality of filtering parameters are associatedwith the second component of the second reconstructed sample, thefiltering parameter values of the first plurality of filteringparameters being equal to the filtering parameter values of the secondplurality of filtering parameters and the filtering parameter values ofthe first plurality of filtering parameters being in inverse order tothe order of the filtering parameter values of the second plurality offiltering parameters.

In another embodiment the device further comprises means for computingfiltering parameters, wherein a first plurality of filtering parametersare associated with the first component of the first reconstructedsample and a second plurality of filtering parameters are associatedwith the second component of the second reconstructed sample, thefiltering parameter values of the first plurality of filteringparameters being equal to the filtering parameter values of the secondplurality of filtering parameters multiplied by a predeterminedweighting factor.

Many further modifications and variations will suggest themselves tothose versed in the art upon making reference to the foregoingillustrative embodiments, which are given by way of example only andwhich are not intended to limit the scope of the invention, that beingdetermined solely by the appended claims. In particular, the differentfeatures from different embodiments may be interchanged, whereappropriate.

In the claims, the word “comprising” does not exclude other elements orsteps, and the indefinite article “a” or “an” does not exclude aplurality. The mere fact that different features are recited in mutuallydifferent dependent claims does not indicate that a combination of thesefeatures cannot be advantageously used.

APPENDIX

TABLE 1 sao type idx SAO type SAO type meaning 0 none No SAO filteringis applied on the frame area 1 edge 1D 0 degree 2 edge 1D 90 degree 3edge 1D 135 degree 4 edge 1D 45 degree 5 band Band offset with bandposition

TABLE 2 Category (J) Conditions Offset 1 C < Cn₁ and C < Cn₂ +O₁ 2 (C <Cn₁ and C == Cn₂) or (C < Cn₂ and C == Cn₁) +O₂ 3 (C > Cn₁ and C == Cn₂)or (C > Cn₂ and C == Cn₁) −O₃ 4 C > Cn₁ and C > Cn₂ −O₄ N.A. None of theabove N.A.

The invention claimed is:
 1. A method of encoding at least a part of an image comprising a plurality of samples, each sample comprising at least two components, the encoded image comprising at least one filtering parameter, the method comprising: encoding a first chroma component and a second chroma component of at least one sample of the image to provide at least one encoded sample; decoding the at least one encoded sample; and computing the at least one filtering parameter as a function of the difference between at least one chroma component of the at least one sample of the image and the at least one corresponding chroma component of the at least one corresponding decoded sample, the at least one filtering parameter being computed so as to be used in a loop filter as a common filtering parameter for sample adaptive offset loop filtering both the first and second chroma components of a decoded sample; wherein when the sample adaptive offset loop filtering is of a first type at least one filtering parameter is computed to be used as a common filtering parameter for the filtering of the first type, the first type of sample adaptive offset loop filtering being one of edge-type filtering and band-type filtering, and when the sample adaptive offset loop filtering is of a second type, different from the first type, different filtering parameters are computed to be used as dedicated filtering parameters for filtering the first and second chroma components respectively, the second type of sample adaptive offset loop filtering being the other of edge-type filtering and band-type filtering.
 2. A method according to claim 1, wherein the first and second chroma components are U and V chroma components respectively.
 3. A method according to claim 1, wherein at least one filtering parameter is computed to be used as a dedicated filtering parameter for filtering an individual one of the first and second chroma components of the at least one decoded sample.
 4. A method according to claim 3, wherein offsets are dedicated filtering parameters.
 5. A method according to claim 1, wherein the or one said filtering parameter is a flag indicating, for a given sample, that one or more filtering parameters used for filtering another sample are to be used to provide corresponding filtering parameters for filtering the given sample.
 6. A method according to claim 1, wherein one said filtering parameter is a flag indicating, for a given sample in a first said part of the image, that one or more filtering parameters used for filtering another sample in a second said part of the image, different from said first part, are to be used to provide corresponding filtering parameters for filtering the given sample.
 7. A method according to claim 1, wherein one said filtering parameter is a left flag indicating, for a given sample in a first said part of the image, that one or more filtering parameters used for filtering another sample in a second said part of the image, to the immediate left of said first part, are to be used to provide corresponding filtering parameters for filtering the given sample, and another said filtering parameter is an upper flag indicating, for said given sample, that one or more filtering parameters used for filtering another sample in a third said part of the image, immediately above said first part, are to be used to provide corresponding filtering parameters for filtering the given sample.
 8. A non-transitory computer-readable storage medium storing instructions of a computer program for implementing each step of a method according to claim
 1. 9. A method of decoding at least a part of an image comprising a plurality of samples, each sample comprising at least two components, the encoded image comprising at least one filtering parameter, the method comprising: decoding a first chroma component and a second chroma component of at least one encoded sample to provide a first chroma component and a second chroma component of at least one reconstructed sample; decoding the at least one filtering parameter; and performing sample adaptive offset loop filtering on the at least one reconstructed sample, the filtering comprising using at least one decoded filtering parameter as a common filtering parameter for filtering both the first chroma component and the second chroma component of the at least one reconstructed sample; wherein when the sample adaptive offset loop filtering is of a first type at least one decoded filtering parameter is used as a common filtering parameter for the filtering of the first type, the first type of sample adaptive offset loop filtering being one of edge-type filtering and band-type filtering, and when the sample adaptive offset loop filtering is of a second type, different from the first type, different decoded filtering parameters are used as dedicated filtering parameters for filtering the first and second chroma components respectively, the second type of sample adaptive offset loop filtering being the other of edge-type filtering and band-type filtering.
 10. A method according to claim 9, wherein the first and second chroma components are U and V chroma components respectively.
 11. A method according to claim 9, wherein at least one decoded filtering parameter is dedicated for filtering an individual one of the first and second chroma components of the at least one reconstructed sample.
 12. A method according to claim 11, wherein offsets are dedicated filtering parameters.
 13. A method according to claim 9, wherein the or one said filtering parameter is a flag indicating, for a given reconstructed sample, that one or more filtering parameters used for filtering another reconstructed sample are to be used to provide corresponding filtering parameters for filtering the given reconstructed sample.
 14. A method according to claim 9, wherein one said filtering parameter is a flag indicating, for a given reconstructed sample in a first said part of the image, that one or more filtering parameters used for filtering another reconstructed sample in a second said part of the image, different from the first said part, are to be used to provide corresponding filtering parameters for filtering the given reconstructed sample.
 15. A method according to claim 9, wherein one said filtering parameter is a left flag indicating, for a given reconstructed sample in a first said part of the image, that one or more filtering parameters used for filtering another reconstructed sample in a second said part of the image, to the immediate left of the first said part, are to be used to provide corresponding filtering parameters for filtering the given reconstructed sample, and another said filtering parameter is an upper flag indicating, for said given reconstructed sample, that one or more filtering parameters used for filtering another reconstructed sample in a third said part of the image, immediately above said first part, are to be used to provide corresponding filtering parameters for filtering the given reconstructed sample.
 16. A non-transitory computer-readable storage medium storing instructions of a computer program for implementing each step of a method according to claim
 9. 17. An encoding device for encoding at least a part of an image comprising a plurality of samples, each sample comprising at least two components, the encoded image comprising at least one filtering parameter, the encoding device comprising: an encoding unit which encodes a first chroma component and a second chroma component of at least one sample of the image to provide at least one encoded sample; a decoding unit which decodes the at least one encoded sample; and a computing unit which computes the at least one filtering parameter as a function of the difference between at least one chroma component of the at least one sample of the image and the at least one corresponding chroma component of the at least one corresponding decoded sample, the at least one filtering parameter being computed so as to be used in a loop filter as a common filtering parameter for sample adaptive offset loop filtering both the first and second chroma components of a decoded sample; wherein the computing unit is operable, when the sample adaptive offset loop filtering is of a first type, to compute at least one filtering parameter to be used as a common filtering parameter for the filtering of the first type, the first type of sample adaptive offset loop filtering being one of edge-type filtering and band-type filtering, and is further operable, when the sample adaptive offset loop filtering is of a second type, different from the first type, to compute different filtering parameters to be used as dedicated filtering parameters for filtering the first and second chroma components respectively, the second type of sample adaptive offset loop filtering being the other of edge-type filtering and band-type filtering.
 18. A decoding device for decoding at least a part of an image comprising a plurality of samples, each sample comprising at least two components, the encoded image comprising at least one filtering parameter, the decoding device comprising: a sample decoding unit which decodes a first chroma component and a second chroma component of at least one encoded sample to provide a first chroma component and a second chroma component of at least one reconstructed sample; a parameter decoding unit which decodes the at least one filtering parameter; and a filtering unit which performs sample adaptive offset loop filtering on the at least one reconstructed sample, the filtering comprising using at least one decoded filtering parameter as a common filtering parameter for filtering both the first chroma component and the second chroma component of the at least one reconstructed sample; wherein the filtering unit is operable, when the sample adaptive offset loop filtering is of a first type, to use at least one decoded filtering parameter as a common filtering parameter for the filtering of the first type, the first type of sample adaptive offset loop filtering being one of edge-type filtering and band-type filtering, and is further operable, when the sample adaptive offset loop filtering is of a second type, different from the first type, to use different decoded filtering parameters as dedicated filtering parameters for filtering the first and second chroma components respectively, the second type of sample adaptive offset loop filtering being the other of edge-type filtering and band-type filtering.
 19. A device according to claim 18, wherein the first and second chroma components are U and V chroma components respectively.
 20. A device according to claim 18, wherein at least one decoded filtering parameter is dedicated for filtering an individual one of the first and second chroma components of the at least one reconstructed sample.
 21. A device according to claim 20, wherein offsets are dedicated filtering parameters.
 22. A device according to claim 18, wherein the or one said filtering parameter is a flag indicating, for a given reconstructed sample, that one or more filtering parameters used for filtering another reconstructed sample are to be used to provide corresponding filtering parameters for filtering the given reconstructed sample.
 23. A device according to claim 18, wherein one said filtering parameter is a flag indicating, for a given reconstructed sample in a first said part of the image, that one or more filtering parameters used for filtering another reconstructed sample in a second said part of the image, different from the first said part, are to be used to provide corresponding filtering parameters for filtering the given reconstructed sample.
 24. A device according to claim 18, wherein one said filtering parameter is a left flag indicating, for a given reconstructed sample in a first said part of the image, that one or more filtering parameters used for filtering another reconstructed sample in a second said part of the image, to the immediate left of the first said part, are to be used to provide corresponding filtering parameters for filtering the given reconstructed sample, and another said filtering parameter is an upper flag indicating, for said given reconstructed sample, that one or more filtering parameters used for filtering another reconstructed sample in a third said part of the image, immediately above said first part, are to be used to provide corresponding filtering parameters for filtering the given reconstructed sample. 